Skip to main content

Play Bettermodel Animation

Play an animation on a BetterModel entity

Fields

FieldTypeDefaultDescription
entityRef<BetterModelInstance>—The BetterModel entity to play the animation on
BetterModelInstance (4)
FieldTypeDefaultDescription
definitionRef<BetterModelDefinition>——
BetterModelDefinition (11)
FieldTypeDefaultDescription
displayNameVar<String>——
soundVar<Sound>EMPTY—
dataList<Ref<EntityData<*>>>empty—
modelIdVar<String>—The BetterModel model ID to use
namedVar<Boolean>falseWhether the entity should display a nametag
defaultAnimationSettingsDefaultAnimationSettings—Default animation settings for the entity
focusOffsetVector—Offset used as focus point for interaction bounds like look_at
headLightVar<Int>0Light level of a fake light block above the entity's head (0 disables)
hitboxesList<BoneHitbox>emptyList of custom hitboxes attached to bones
nameOffsetDouble2.3Y offset for the name display above the entity. Use this to adjust the text display height.
showDisplayNameBooleantrueWhether to show the display name above the entity
spawnLocationVar<Position>ORIGIN—With rotation
dataList<Ref<EntityData<*>>>empty—
activityRef<out SharedEntityActivityEntry>——
animationVar<String>idleThe name of the animation to play
animationSettingsAnimationSettings—Animation playback settings
AnimationSettings (4)
FieldTypeDefaultDescription
lerpInDuration250The duration of the lerp in effect
lerpOutDuration250The duration of the lerp out effect
speedDouble1.0The speed of the animation
forceBooleanfalseForce the animation to play, stopping others
Common TypeWriter fields (criteria, modifiers, triggers)
FieldTypeDefaultDescription
criteriaList<Criteria>empty—
modifiersList<Modifier>empty—
triggersList<Ref<TriggerableEntry>>empty—

How to use it​

entity must be a BetterModel Instance that is currently displayed. animation is the exact Blockbench animation name. animationSettings sets lerpIn and lerpOut (blend durations, 250 ms by default), speed, and force, which stops other animations to play this one. Nothing happens if the entity is not visible or the animation name is empty.