Triggers
Triggers define when a skill activates. They are always prefixed with ~ and come at the end of a skill line.
Syntax
action{params} @target{params} ~trigger{params}
A skill line always ends with at least one trigger. Multiple triggers can be combined on a single line.
Quick Example
Skills:
- animation{name=idle, mode=loop} ~idle
- animation{name=walk, mode=loop} ~moving
- animation{name=hurt} ~onHurt
- animation{name=death} ~onDeath
All Triggers
Lifecycle
Triggers that fire during entity lifecycle events.
| Trigger | Description |
|---|---|
| ~onSpawn | Fires once when the entity spawns into the world |
| ~onDeath | Fires once when the entity dies |
| ~onLoad | Fires when an entity is loaded from save data |
| ~onDespawn | Fires when an entity is removed (not death) |
Combat
Triggers related to combat actions and state.
| Trigger | Description |
|---|---|
| ~onHurt | Fires when the entity takes damage |
| ~onAttack | Fires when the entity hits a target with a melee attack |
| ~onKill | Fires when the entity kills another entity |
| ~onEnterCombat | Fires when the entity first enters combat |
| ~onDropCombat | Fires when the entity leaves combat (10s no damage) |
| ~onTargetChange | Fires when the entity changes its attack target |
| ~onShoot | Fires when the entity performs a ranged attack |
| ~onExplode | Fires just before a creeper-like entity explodes |
Utility
General purpose triggers for timers, interaction, and signals.
| Trigger | Description |
|---|---|
| ~onTimer | Fires repeatedly at a specified interval |
| ~onInteract | Fires when a player right-clicks the entity |
| ~onSignal | Fires when the entity receives a signal |
State
Continuous triggers that fire while a condition is true.
| Trigger | Description |
|---|---|
| ~idle | Fires while the entity is not moving |
| ~moving | Fires while the entity is moving |
| ~health | Fires based on health percentage thresholds |
Pet
Triggers for tameable entities. Require the Taming module.
| Trigger | Description |
|---|---|
| ~tamed | Fires while the entity is tamed |
| ~untamed | Fires while the entity is not tamed |
| ~sitting | Fires while the entity is ordered to sit |
Common Parameters
Most triggers support these common parameters:
| Parameter | Type | Description |
|---|---|---|
once | boolean | Only trigger once per entity lifetime |
Some triggers have additional parameters documented on their individual pages.
Combining Triggers
You can combine state triggers on a single line:
Skills:
# Different idle animations based on tame status
- animation{name=happy_idle, mode=loop} ~idle ~tamed
- animation{name=wary_idle, mode=loop} ~idle ~untamed
# Different movement at low health
- animation{name=limp, mode=loop} ~moving ~health{below=25}
- animation{name=walk, mode=loop} ~moving
Skill Order
Skills are evaluated in order. For state triggers, the first matching skill wins:
Skills:
# More specific conditions first
- animation{name=sprint, mode=loop} ~moving{speed=0.5}
- animation{name=run, mode=loop} ~moving{speed=0.3}
- animation{name=walk, mode=loop} ~moving
- animation{name=idle, mode=loop} ~idle