Triggers
Item triggers let an item run actions when clicked, consumed, equipped, unequipped, or used in combat. They are useful for scrolls, potions, quest items, right-click skill items, and passive equipment effects.
Trigger types
| Trigger | When it fires | Typical use |
|---|---|---|
right_click | Player right-clicks the item. | Scrolls, menus, skills. |
left_click | Player left-clicks. | Tools or debug items. |
consume | Item is consumed. | Food, potions, buffs. |
equip | Item is equipped. | Set bonuses or passive effects. |
unequip | Item is removed. | Remove passive effects. |
attack | Player hits an entity. | Weapon effects and lifesteal. |
Example
yaml
id: town_scroll
display_name: '<aqua>Town Scroll'
material: PAPER
triggers:
right_click:
cooldown: 3000
consume: true
conditions:
- type: world
value: world
actions:
- 'sendmessage <green>Teleporting to town.'
- 'command spawn %player%'Conditions should pass before consuming the item. Add cooldowns to combat triggers to avoid event hot spots.