Triggers
A trigger is the event that makes an ability run. Every enchant, set, or crystal declares exactly one trigger with the trigger: key, and it answers a single question: "when should this fire?"
enchant:
trigger: ATTACK # fire when the wearer lands a melee hit
levels:
1:
chance: 30
effects:
- { POTION: { effect: POISON, level: 1, duration: 60 } }
Triggers take no arguments — you just name one. The hard part is picking the right one, so the table below explains each in plain words.
What the columns mean
- Side — which "team" of the combat fold the trigger belongs to:
- Attack — fires when you are dealing damage. Use these for offensive effects (extra damage, debuffs on your victim).
- Defense — fires when you are taking damage. Use these for retaliation, shielding, escape.
- Neutral — not tied to combat at all (mining, eating, a repeating timer, etc.).
- Held item — Yes means the trigger looks at the item in your hand (tools, weapons used by hand). When this is the case, the enchant only counts when that item is held.
- Scans armour — Yes means the engine checks your worn equipment for this enchant, so it can fire from armor (and held gear). This is how passive armor enchants and most combat enchants work.
- Needs target — Yes means the event must involve another entity (a victim or attacker). Triggers without a target fire on you/your location alone.
:::tip Match the trigger to the side of your effect
Defensive effects (GUARD, KNOCKBACK_CONTROL on yourself, retaliation DAMAGE) belong on a DEFENSE trigger; offensive ones belong on ATTACK. Putting a retaliation effect on ATTACK (or vice-versa) is the most common reason an enchant "does nothing."
:::
:::note PASSIVE vs REPEATING
Both are always-on while the item is worn, but they differ:
PASSIVEis a continuous state — best for effects that are a condition (a permanent potion buff, aHEALTHbump). The engine keeps them applied while worn and cleans them up on unequip.REPEATINGruns on a fixed timer — best for periodic upkeep (top up a buff, lay aWALKERplatform, refreshKEEP_ON_DEATH).repeat: Nis the period in ticks;repeat-delay: Dmoves the first run toDticks after equip instead of a full period out, so an upkeep ability can start straight away without shortening the loop. :::
| Trigger | Side | When does it fire? | Held item | Scans armour | Needs target |
|---|---|---|---|---|---|
| ATTACK | Attack | You land a melee hit on a living target. | — | Yes | Yes |
| BOW | Attack | Your fired arrow hits a target (the hit, not the shot). | — | Yes | Yes |
| TRIDENT | Attack | Your thrown/melee trident hits a target. | — | Yes | Yes |
| KILL | Attack | Your hit kills the target. | — | Yes | Yes |
| BOW_FIRE | Attack | You release a bow shot (the moment the arrow leaves). | — | Yes | — |
| DEFENSE | Defense | Something deals damage to you. | — | Yes | Yes |
| FALL | Defense | You take fall damage. | — | Yes | — |
| FIRE | Defense | You take fire/burning damage. | — | Yes | — |
| PASSIVE | Neutral | Always on while the item is worn (no event needed). | — | Yes | — |
| MINE | Neutral | You break a block while mining. | — | Yes | — |
| DEATH | Neutral | You die. | — | Yes | — |
| HELD | Neutral | The item is in your hand (held), checked continuously. | Yes | — | — |
| BREAK | Neutral | You break a block with this held item. | Yes | — | — |
| ITEM_DAMAGE | Neutral | This held item loses durability. | — | Yes | — |
| EAT | Neutral | You finish eating/drinking while holding this item. | — | Yes | — |
| FISHING | Neutral | You reel in a catch with this fishing rod. | Yes | — | — |
| INTERACT | Neutral | You right- or left-click with this held item. | Yes | — | — |
| INTERACT_LEFT | Neutral | You left-click with this held item. | Yes | — | — |
| INTERACT_RIGHT | Neutral | You right-click with this held item. | Yes | — | — |
| REPEATING | Neutral | On a fixed timer while worn (good for always-on upkeep effects). | — | Yes | — |
| COMMAND | Neutral | Fired explicitly by a command, not a game event. | — | Yes | — |
| IMPACT | Attack | Fires on its matching game event. | — | Yes | Yes |
| EXP_GAIN | Neutral | Fires on its matching game event. | — | Yes | — |
| USE | Neutral | Fires on its matching game event. | Yes | — | — |
| GUARDIAN_HURT | Neutral | Fires on its matching game event. | — | Yes | — |
| HURT | Defense | Fires on its matching game event. | — | Yes | — |
| EQUIP_CHANGE | Neutral | Fires on its matching game event. | — | Yes | — |
| PROJECTILE_LAND | Neutral | Fires on its matching game event. | — | Yes | — |
| PROXIMITY_EVENT | Neutral | Fires on its matching game event. | — | Yes | Yes |
| SUMMON_PAYLOAD | Neutral | Fires on its matching game event. | — | Yes | Yes |
See also
- Effects — what runs when a trigger fires.
- Conditions & variables — only fire when the situation is right.