> ## Documentation Index
> Fetch the complete documentation index at: https://entities.lodemc.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Animating Your Model

> Animations that play themselves, testing them, math-driven motion, and running skills on a keyframe.

Animations are made in Blockbench's **Animate** tab and travel inside your `.bbmodel`. LodeEntities plays them automatically or on demand.

## Making an animation

In Blockbench, switch to the Animate tab, create a new animation and give it a name. Then move your [bones](https://entities.lodemc.net/creating-a-model.md) along the timeline: rotate the legs for a walk, bob the head for an idle, collapse everything for a death. Blockbench fills in the frames between your keyframes.

Save the file over the old one in `Mobs/`, `/le reload`, and the animations come with it.

## Animations that play themselves

Name an animation one of these and it runs at the right moment with no configuration:

| Animation name | Plays when |
| - | - |
| `idle` | the mob is standing around |
| `walk` | the mob is moving |
| `spawn` | the mob appears |
| `death` | the mob dies |
| `damage` | the mob is hurt |
| `jump` | the mob jumps |
| `idle_fly` | idle, for flying bases |
| `walk_fly` | moving, for flying bases |

So the recipe for a lively mob is: make an `idle` and a `walk`, name them exactly that, done.

How fast each of these plays is set per mob with `animation-speed`, without touching the model:

```yaml theme={null}
warhog:
  base: pig
  model: warhog
  animation-speed: { walk: 1.5, idle: 0.8 }
```

Walking also speeds up and slows down with Speed and Slowness on top of this. See [Mob Stats](https://entities.lodemc.net/mob-fields.md#animation-speed).

## Testing an animation

Preview any animation, including custom-named ones, without writing an effect:

```text theme={null}
/le test <mob> <animation>
```

It spawns the model and plays the animation once. Tweak in Blockbench, save, reload, test, repeat.

## Playing your own animations

Animations with any other name (`attack`, `roar`, `cast`) don't play on their own. Play them from an effect line:

```yaml theme={null}
- animation{name=slam;loop=once} +onAttack @self
- animation{name=roar} +onSpawn @self
```

See [Model Animation](https://entities.lodemc.net/mechanics-animation.md) for every option.

## Effects on an animation frame

The other direction works too: a frame of an animation can run a skill. In Blockbench, add a **script keyframe** on the animation's *Effects* timeline and write:

```text theme={null}
effect:<skill id>
```

The skill runs on that frame, with the animated mob as the caster and its AI target as `@target`. A fireball leaves on the frame the arms swing, instead of after a guessed `delay`. Metadata becomes the skill's parameters: `effect:volley{count=3}` makes `<skill.count>` read 3.

Model Engine's `mm:<id>` keyframes do the same while MythicMobs isn't installed; with MythicMobs installed they cast its skills, as before.

> [!NOTE]
>
> Animations only advance while a player can see the model, so a keyframe never fires for a mob nobody is watching.

## Animating with math

Keyframe values don't have to be plain numbers: they can be **math expressions** (Molang), evaluated live. `query.anim_time` is the current animation time, so a keyframe like `math.sin(query.anim_time * 90) * 3` makes a bone sway continuously without placing dozens of keyframes.

Use it for perpetual motion: hovering crystals, swinging lanterns, breathing chests. A few advanced Molang queries aren't available; if an expression doesn't work, simplify it.

## Next step

Bones can do more than move: [Bone Tags](https://entities.lodemc.net/bone-tags.md) give them behaviours.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.