Creator Academy

Bedrock animation controllers explained simply

An animation controller is a JSON state machine in the resource pack. Each state lists animations to play, and transitions move to another state when a Molang condition becomes true, such as night falling or the mob moving. The client entity names the controller and starts it under scripts, animate.

Updated

Animations vs animation controllers

An animation is the movement itself: keyframes that rotate, move or scale bones over time. It lives in a .animation.json file. An animation controller holds no movement at all. It only decides which animations play right now, and when to switch.

Think of the animations as the moves and the controller as the one calling them out: walk while moving, stand still when stopped, do the special pose at night.

States, initial_state and transitions

A controller is a list of states. The mob is in exactly one state of each controller at a time.

Molang is the small expression language Bedrock uses for conditions and maths, with queries such as query.is_moving or query.modified_move_speed.

A real example: a night controller

This controller has two states, off and on. It plays a motion called glow_pulse only at night. It follows the pattern a Mobloom export uses when you add the rule "when it's night, play motion".

{
  "format_version": "1.10.0",
  "animation_controllers": {
    "controller.animation.mobloom_moss_golem.night": {
      "initial_state": "off",
      "states": {
        "off": {
          "blend_transition": 0.2,
          "transitions": [{ "on": "query.property('mobloom:night')" }]
        },
        "on": {
          "animations": ["glow_pulse"],
          "blend_transition": 0.2,
          "transitions": [{ "off": "!(query.property('mobloom:night'))" }]
        }
      }
    }
  }
}

The condition reads an entity property called mobloom:night. The behavior pack sets that property to true when night falls and back to false in the morning, so the resource pack can see it.

blend_transition for smooth changes

Without blending, a mob snaps from one pose to the next the moment a state changes. blend_transition is a time in seconds over which Minecraft fades from the old state's pose into the new one. A small value such as 0.2 is enough to make the change look smooth.

How the client entity wires it up

A controller does nothing until the client entity knows about it. Two steps: give the animation and the controller short names under animations, then start the controller under scripts.animate.

{
  "format_version": "1.10.0",
  "minecraft:client_entity": {
    "description": {
      "identifier": "mobloom:moss_golem",
      "animations": {
        "glow_pulse": "animation.mobloom_moss_golem.glow_pulse",
        "night": "controller.animation.mobloom_moss_golem.night"
      },
      "scripts": { "animate": ["night"] }
    }
  }
}

The controller then uses the short name glow_pulse in its states. The long names appear only once, in the client entity.

Common mistakes

If the whole mob is missing, not just its motion, start with Custom Bedrock mob invisible? Fixes.

How Mobloom does it

In Mobloom you never open this file. Your motions become animations, and Mobloom writes the controllers that decide when they play: one for motions that run all the time, one that switches between still and moving, and small ones like the night controller above when your rules need them. Every short name is declared and matched for you. See How to animate a custom Bedrock mob, or start with Make a Bedrock mob without writing JSON. For where this file sits in the pack, see What files does a custom Bedrock mob need?

Questions

Do I need an animation controller for a walk animation?

Not always. A simple animation can be started directly under scripts, animate in the client entity, with a Molang value that turns it on and off. Controllers are cleaner once you have more than one state.

What is Molang?

Molang is the expression language Bedrock uses inside JSON files for conditions and maths, such as checking whether a mob is moving.

Are these the same as behavior pack animation controllers?

No. Behavior pack controllers run commands and events on the server side. Resource pack controllers play the visuals.

Sources: Microsoft Learn, Introduction to Animation Controllers; Bedrock Wiki, Intro to Animation Controllers; a real Mobloom export.

Make your mob. Skip the JSON.

Start free in your browser. No card needed to create.

Start creating free