#:
yaml
#onSpawn.
~also works as a trigger prefix (~onHurt) if you prefer it over#.
Available triggers
Triggers set the target
Each trigger defines who@target points to. That’s what makes lines like these work:
#onSpawnhas no target. A spawn isn’t caused by any entity, so@targetresolves to nothing there. Use@self,@playersRadius[N]or@worldinstead.- The target can be empty even on other triggers. A mob that dies to fall damage has no killer, so an
#onDeath @targetline simply does nothing. Environmental damage on#onHurtbehaves 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’seffects: 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.

