Skip to main content

Mythicmob NPC Play Animation

Plays a ModelEngine animation on a MythicMob NPC

Fields

FieldTypeDefaultDescription
targetMythicMobNpcFactTarget——
MythicMobNpcFactTarget (2)
FieldTypeDefaultDescription
npcRef<MythicMobNpcInstance>—MythicMob NPC instance to inspect.
MythicMobNpcInstance (6)
FieldTypeDefaultDescription
definitionRef<MythicMobNpcDefinition>——
spawnLocationVar<Position>ORIGIN—With rotation
dataList<Ref<EntityData<*>>>empty—
activityRef<out EntityActivityEntry>——
groupRef<out GroupEntry>——
secondaryOffsetVector{"x":0.0,"y":0.0,"z":0.0}Offset (X, Y, Z) for the secondary focus point (automatically created with empty text)
radiusDouble?—Custom search radius in blocks when matching the active mob. 0 uses the default of 5 blocks.
animationString—The name of the animation to play.
speedDouble1.0The speed at which to play the animation. 0 or less plays at normal speed.
forceBooleanfalseWhether to force the animation to play: every other animation previously started on this NPC by this action is stopped first, so none of them shows again once this one ends. Off: they keep running underneath. The animation always restarts from its first frame.
Common TypeWriter fields (criteria, modifiers, triggers)
FieldTypeDefaultDescription
criteriaList<Criteria>empty—
modifiersList<Modifier>empty—
triggersList<Ref<TriggerableEntry>>empty—

How to use it​

Fill target.npc with the instance and animation with the animation name from the model (BetterModel or ModelEngine). The animation plays once, then the NPC goes back to its idle or walk animation. target.radius is the search radius around the spawn point (default 5 blocks, also used when it is 0). speed is the playback speed; 0 or less plays at normal speed. With force on, the other animations this action started on the NPC are stopped first, so none of them shows again once this one ends; off, they keep running underneath. The animation always restarts from its first frame. The action does nothing without a model engine.

The animation plays above the NPC's idle and walk animations and above animations started by the mob's MythicMobs skills. When the model is not there yet, for example at the start of a cinematic in a world that just loaded, the action waits up to 2 seconds for it. It works with ticking on and off. A Mythicmob NPC Stop Animation with an empty name also cancels an animation still waiting for its model.