> For the complete documentation index, see [llms.txt](https://enchantedmobs.superiormc.cn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://enchantedmobs.superiormc.cn/for-enchantmentreform/configs/triggers.md).

# Power Triggers

A trigger is a section under an enchantment's `powers`. It decides when the power runs and creates the context consumed by Power Conditions, Power Modifiers, and Abilities.

```yaml
powers:
  on-attack:
    conditions: {}
    modifiers: {}
    abilities: {}
```

EnchantmentReform currently registers **61 built-in triggers**.

## Reference pages

* [Tick and lifecycle triggers](/for-enchantmentreform/configs/triggers/lifecycle.md)
* [Combat, damage, and death triggers](/for-enchantmentreform/configs/triggers/combat.md)
* [Projectile and ranged triggers](/for-enchantmentreform/configs/triggers/projectiles.md)
* [Block and interaction triggers](/for-enchantmentreform/configs/triggers/blocks-interactions.md)
* [Item, enchanting, and equipment triggers](/for-enchantmentreform/configs/triggers/items-equipment.md)
* [Movement and input triggers](/for-enchantmentreform/configs/triggers/movement-input.md)
* [Effects, air, food, and experience triggers](/for-enchantmentreform/configs/triggers/player-state.md)
* [Fishing and trading triggers](/for-enchantmentreform/configs/triggers/fishing-trading.md)
* [Targeting and special-entity triggers](/for-enchantmentreform/configs/triggers/targeting-special.md)

## Common context

Every trigger creates a `TriggerData` context. The exact value of each role depends on the selected trigger.

| Context                         | Meaning                                                                                     |
| ------------------------------- | ------------------------------------------------------------------------------------------- |
| `PLAYER`                        | The player whose active enchanted item supplied the power. This is always present.          |
| `SOURCE`                        | The actor or owner responsible for the event.                                               |
| `SKILL`                         | The direct carrier or intermediate entity, such as a projectile, hook, firework, or Warden. |
| `TARGET`                        | The final affected or inspected entity.                                                     |
| `BLOCK`                         | The event block when the trigger supplies one.                                              |
| `LOCATION`                      | Main event location used by location-aware conditions and abilities.                        |
| `FROM` / `TO`                   | Movement origin and destination when supplied.                                              |
| `TRIGGER_ITEM` / `TRIGGER_SLOT` | Item and slot that selected the active enchantment.                                         |
| `EVENT`                         | Underlying Bukkit/Paper event.                                                              |
| `TICK`                          | Runtime tick for periodic triggers.                                                         |

`SOURCE`, `SKILL`, `TARGET`, `BLOCK`, movement locations, and trigger-item data are optional. A condition or ability that requires missing context fails or skips safely.

{% hint style="info" %}
Do not assume the same selector has the same meaning across every trigger. For example, `on-attack` uses `SOURCE` for the attacking player and `SKILL` for the direct projectile/damager, while `on-damage` uses `TARGET` for the enchanted player receiving damage.
{% endhint %}

## Trigger list

### Tick and lifecycle triggers

* [`on-tick`](/for-enchantmentreform/configs/triggers/lifecycle.md#on-tick)
* [`on-target-tick`](/for-enchantmentreform/configs/triggers/lifecycle.md#on-target-tick)
* [`on-spawn`](/for-enchantmentreform/configs/triggers/lifecycle.md#on-spawn)
* [`on-respawn`](/for-enchantmentreform/configs/triggers/lifecycle.md#on-respawn)
* [`on-activate`](/for-enchantmentreform/configs/triggers/lifecycle.md#on-activate)
* [`on-deactivate`](/for-enchantmentreform/configs/triggers/lifecycle.md#on-deactivate)

### Combat, damage, and death triggers

* [`on-attack`](/for-enchantmentreform/configs/triggers/combat.md#on-attack)
* [`on-melee-attack`](/for-enchantmentreform/configs/triggers/combat.md#on-melee-attack)
* [`on-damage`](/for-enchantmentreform/configs/triggers/combat.md#on-damage)
* [`on-damage-by-entity`](/for-enchantmentreform/configs/triggers/combat.md#on-damage-by-entity)
* [`on-kill`](/for-enchantmentreform/configs/triggers/combat.md#on-kill)
* [`on-death`](/for-enchantmentreform/configs/triggers/combat.md#on-death)
* [`on-regain`](/for-enchantmentreform/configs/triggers/combat.md#on-regain)
* [`on-combust`](/for-enchantmentreform/configs/triggers/combat.md#on-combust)
* [`on-knockback`](/for-enchantmentreform/configs/triggers/combat.md#on-knockback)
* [`on-attempt-smash-attack`](/for-enchantmentreform/configs/triggers/combat.md#on-attempt-smash-attack)
* [`on-lunge`](/for-enchantmentreform/configs/triggers/combat.md#on-lunge)
* [`on-shield-block`](/for-enchantmentreform/configs/triggers/combat.md#on-shield-block)
* [`on-shield-disable`](/for-enchantmentreform/configs/triggers/combat.md#on-shield-disable)

### Projectile and ranged triggers

* [`on-shoot`](/for-enchantmentreform/configs/triggers/projectiles.md#on-shoot)
* [`on-shoot-bow`](/for-enchantmentreform/configs/triggers/projectiles.md#on-shoot-bow)
* [`on-load-crossbow`](/for-enchantmentreform/configs/triggers/projectiles.md#on-load-crossbow)
* [`on-projectile-launch`](/for-enchantmentreform/configs/triggers/projectiles.md#on-projectile-launch)
* [`on-projectile-tick`](/for-enchantmentreform/configs/triggers/projectiles.md#on-projectile-tick)
* [`on-projectile-hit`](/for-enchantmentreform/configs/triggers/projectiles.md#on-projectile-hit)
* [`on-riptide`](/for-enchantmentreform/configs/triggers/projectiles.md#on-riptide)

### Block and interaction triggers

* [`on-block-break`](/for-enchantmentreform/configs/triggers/blocks-interactions.md#on-block-break)
* [`on-block-damage`](/for-enchantmentreform/configs/triggers/blocks-interactions.md#on-block-damage)
* [`on-block-break-progress-update`](/for-enchantmentreform/configs/triggers/blocks-interactions.md#on-block-break-progress-update)
* [`on-block-drop-item`](/for-enchantmentreform/configs/triggers/blocks-interactions.md#on-block-drop-item)
* [`on-block-place`](/for-enchantmentreform/configs/triggers/blocks-interactions.md#on-block-place)
* [`on-inside-block`](/for-enchantmentreform/configs/triggers/blocks-interactions.md#on-inside-block)
* [`on-interact`](/for-enchantmentreform/configs/triggers/blocks-interactions.md#on-interact)
* [`on-consume`](/for-enchantmentreform/configs/triggers/blocks-interactions.md#on-consume)
* [`on-name-entity`](/for-enchantmentreform/configs/triggers/blocks-interactions.md#on-name-entity)

### Item, enchanting, and equipment triggers

* [`on-item-damage`](/for-enchantmentreform/configs/triggers/items-equipment.md#on-item-damage)
* [`on-item-group-cooldown`](/for-enchantmentreform/configs/triggers/items-equipment.md#on-item-group-cooldown)
* [`on-item-held`](/for-enchantmentreform/configs/triggers/items-equipment.md#on-item-held)
* [`on-swap-hand`](/for-enchantmentreform/configs/triggers/items-equipment.md#on-swap-hand)
* [`on-enchant-item`](/for-enchantmentreform/configs/triggers/items-equipment.md#on-enchant-item)
* [`on-elytra-boost`](/for-enchantmentreform/configs/triggers/items-equipment.md#on-elytra-boost)

### Movement and input triggers

* [`on-move`](/for-enchantmentreform/configs/triggers/movement-input.md#on-move)
* [`on-input`](/for-enchantmentreform/configs/triggers/movement-input.md#on-input)
* [`on-jump`](/for-enchantmentreform/configs/triggers/movement-input.md#on-jump)
* [`on-toggle-flight`](/for-enchantmentreform/configs/triggers/movement-input.md#on-toggle-flight)
* [`on-toggle-sneak`](/for-enchantmentreform/configs/triggers/movement-input.md#on-toggle-sneak)

### Effects, air, food, and experience triggers

* [`on-effect-tick`](/for-enchantmentreform/configs/triggers/player-state.md#on-effect-tick)
* [`on-potion-effect`](/for-enchantmentreform/configs/triggers/player-state.md#on-potion-effect)
* [`on-exhaustion`](/for-enchantmentreform/configs/triggers/player-state.md#on-exhaustion)
* [`on-food-level-change`](/for-enchantmentreform/configs/triggers/player-state.md#on-food-level-change)
* [`on-air-change`](/for-enchantmentreform/configs/triggers/player-state.md#on-air-change)
* [`on-exp-change`](/for-enchantmentreform/configs/triggers/player-state.md#on-exp-change)
* [`on-pickup-experience`](/for-enchantmentreform/configs/triggers/player-state.md#on-pickup-experience)

### Fishing and trading triggers

* [`on-fish`](/for-enchantmentreform/configs/triggers/fishing-trading.md#on-fish)
* [`on-purchase`](/for-enchantmentreform/configs/triggers/fishing-trading.md#on-purchase)
* [`on-trade`](/for-enchantmentreform/configs/triggers/fishing-trading.md#on-trade)

### Targeting and special-entity triggers

* [`on-target`](/for-enchantmentreform/configs/triggers/targeting-special.md#on-target)
* [`on-untag`](/for-enchantmentreform/configs/triggers/targeting-special.md#on-untag)
* [`on-creeper-explode`](/for-enchantmentreform/configs/triggers/targeting-special.md#on-creeper-explode)
* [`on-phantom-pre-spawn`](/for-enchantmentreform/configs/triggers/targeting-special.md#on-phantom-pre-spawn)
* [`on-warden-anger-change`](/for-enchantmentreform/configs/triggers/targeting-special.md#on-warden-anger-change)

## Choosing compatible conditions and modifiers

Choose the trigger first, then open its category page and verify the available Context.

Examples:

* the `damage` modifier requires a trigger with mutable damage data;
* `item_damage` requires `on-item-damage`;
* fishing result modifiers require `on-fish` and the appropriate fishing state;
* trade modifiers require `on-purchase` or `on-trade`;
* `warden_anger` requires `on-warden-anger-change`;
* block conditions require a trigger that supplies `BLOCK`;
* entity-targeted abilities must use a selector that is present for that trigger.

## Extension triggers

Other plugins may register custom triggers through the EnchantmentReform API. Custom trigger keys and their Context are defined by the extension and are not included in this built-in list.
