Skip to main content
A trigger decides when an effect line runs. It’s the part prefixed with +:
If a line has no trigger, it defaults to +onSpawn. The on is optional — +hurt and +onHurt are the same trigger. Write whichever reads better.
Why + and not #? # is YAML’s comment character. Older versions accepted #onHurt, and it only worked because the loader quotes list items before YAML ever sees them. One hand-edit that broke that quoting turned a whole effect line into a comment, silently. + has no such meaning in YAML.# and ~ still parse, so existing files keep working, and they are rewritten to + automatically the next time the file loads. Nothing to migrate by hand.

Available triggers

An addon can add more: see Extending the Effect Language.

Triggers set the target

Each trigger defines who @target points to. That’s what makes lines like these work:
Two things to keep in mind:
  • +onSpawn has no target. A spawn isn’t caused by any entity, so @target resolves to nothing there. Use @self, @playersRadius[N] or @world instead.
  • The target can be empty even on other triggers. A mob that dies to fall damage has no killer, so an +onDeath @target line simply does nothing. Environmental damage on +onHurt behaves the same way.

One trigger, many lines

Multiple lines can share a trigger. They run in order:

Where triggers apply

Triggers only exist on a mob’s effects: list. Lines inside named effects never carry a trigger of their own: they inherit the moment they were called from. The run line has the trigger, the named effect just executes.