Skip to main content

megstate

megstate [model:<active_model>] [state:<state>] ((speed:<#.#>/{1}) (lerp_in:<duration>/{0}) (lerp_out:<duration>/{0}) (loop:once/loop/hold) (override:true/false) (force)/remove (ignore_lerp) (priority:<#>/{1}))

Plays a state on a modeled entity. This command is similar to the "state" Mythic Mechanic. The documentation can be found here.

If the 'remove' argument is specified, the state will be removed. If the 'state' argument is not specified, all states will be removed.

Arguments

ArgumentInputRequiredDefaultDescription
modelMegActiveModelTagyesThe entity to play the state on.
priorityElementTag(Integer)no1Remove the animation of the specified priority, or adds an animation with the specified priority.

If remove is not specified

If remove is not specified, the command will play a state on the entity.

ArgumentInputRequiredDefaultDescription
stateElementTagyesThe state to play.
speedElementTagno1The speed multiplier of the animation.
lerp_inDurationTagno0The lerp in duration; transition when the animation starts.
lerp_outDurationTagno0The lerp out duration; transition when the animation ends.
looponce/loop/holdnoThe loop type of the animation. If not set, will use the default animation loop mode specified on blockbench.
overrideElementTagnofalseWhether the animation should override the current animation.

If remove is specified

If remove is specified, the command will remove a state from the entity.

ArgumentInputRequiredDefaultDescription
stateElementTagnoThe state to remove. If unspecified, will remove all states.
ignore_lerpElementTag(Boolean)nofalseWhether the state should be instantly removed without transition (lerping).

Examples

# Play the "wave" state on the entity the player's looking at, with a 0.5 second lerp in and out.
- megstate model:<player.target> state:wave lerp_in:0.5s lerp_out:0.5s
# Removes the "wave" state from the entity the player's looking at.
- megstate model:<player.target> state:wave remove
# Removes all states from the entity the player's looking at.
- megstate model:<player.target> remove