AnimationManager

public class AnimationManager

Plays a model's animations in two layers and mixes them into one pose per tick.

  • Base layer: a locomotion machine (spawn, idle, walk, death) driven by TRANSITIONS, or a custom animation played with blend=false, which takes the whole pose over while the machine keeps tracking idle and walk underneath.
  • Action layer: attacks, damaged, and custom animations played with blend=true. An action replaces the bones it keys when its Blockbench Override is set and adds to them otherwise.
Idle and walk cross-fade into each other and death fades in from whatever pose the model holds; every other switch snaps. Custom animations outrank built-in ones, and only death interrupts them.

Requests can come from any thread; they are queued and applied on the model clock, which owns all state here.

Constructors

Link copied to clipboard
public void AnimationManager(ModeledEntity modeledEntity, AnimationsBlueprint bp)

Functions

Link copied to clipboard
public boolean hasAnimation(String animationName)
Link copied to clipboard
public boolean isOnlyLocomotionPlaying()
Whether only the idle or walk loop plays: no attack, custom animation, spawn or death.
Link copied to clipboard
public boolean isPoseStale()
Whether the last render skipped the pose, which refreshPose then samples.
Link copied to clipboard
public boolean play(String name, boolean blend, boolean loop)
Plays a built-in state (idle, walk, spawn, death), an attack, or any animation by name.
Link copied to clipboard
public void refreshPose()
Samples the pose the last render skipped, so the bones hold what they would have.
Link copied to clipboard
public void stop()
Ends every custom animation and attack and snaps the model to idle.
Link copied to clipboard
public void tick()