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

# Animating Your Model

> Built-in auto-playing animations, testing, and math-driven motion.

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

\[Image here: The Blockbench Animate tab with a walk animation on the timeline]

## Making an animation

In Blockbench, switch to the Animate tab, create a new animation, and give it a name. Then move your [bones](creating-a-model) along the timeline: rotate the legs for a walk, bob the head for an idle, collapse everything for a death. Keyframe by keyframe, Blockbench interpolates the rest.

Save the file, re-import it (drop in `models/`, `/nme reload`), and the animations come with it.

## Animations that play themselves

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

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

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

\[Image here: Side-by-side of a mob standing (idle animation) and moving (walk animation) in-game]

## Testing an animation

Preview any animation, including custom-named ones, without touching effects:

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

It spawns the model and plays the animation once. Perfect for iterating: tweak in Blockbench, save, reload, test, repeat.

## Animating with math

Keyframe values don't have to be plain numbers: they can be **math expressions** (Molang), evaluated live. The variable `query.anim_time` gives you 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.

\[Image here: A Blockbench keyframe panel with a math expression entered as the value]

Use it for perpetual motion: hovering crystals, swinging lanterns, breathing chests. For the full expression language, see the Molang reference (Minecraft's official docs cover it well). A few advanced Molang queries aren't available, if an expression doesn't work, simplify it.

## Custom animations and effects

Animations named anything else (`attack`, `roar`, `cast`) don't play on their own. They're yours to trigger from gameplay. That's a job for the [Effects](overview) system, which can play animations as part of a mob's attack sequences.

## Next step

Bones can do more than move: [Bone Tags](bone-tags) give them behaviors.
