> 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/configuration/triggers/targeting-special.md). Agents can also search and read this documentation through its [MCP server](https://enchantedmobs.superiormc.cn/~gitbook/mcp).

# Targeting and Special-Entity Triggers

These triggers cover monster targeting, creeper priming, Enderman gaze aggression, phantom pre-spawn, and Warden anger.

Each trigger section below documents the runtime context created by the current implementation.

| Context                         | Meaning                                                                                                                                           |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `PLAYER`                        | The player whose active enchantment is being evaluated.                                                                                           |
| `SOURCE`                        | The actor or owner responsible for the event.                                                                                                     |
| `SKILL`                         | The direct carrier/intermediate entity, such as a projectile, hook, firework, or Warden.                                                          |
| `TARGET`                        | The final affected or inspected entity. It may be unavailable for some events.                                                                    |
| `BLOCK`                         | The event block, when the trigger supplies one.                                                                                                   |
| `LOCATION`                      | The main event location used by location-aware conditions and abilities.                                                                          |
| `TRIGGER_ITEM` / `TRIGGER_SLOT` | The item and equipment slot that selected the active enchantment.                                                                                 |
| `EVENT`                         | The underlying Bukkit/Paper event. Trigger-specific state not copied into another field remains available through the event-aware implementation. |

When a role is marked **player**, it resolves to the same entity as `PLAYER`. A missing role resolves to `null`; conditions or abilities requiring it will fail or skip safely.

## `on-target`

Supported `count`: `events`.

Runs when an entity selects a player as its target.

| Context             | Value                                                                              |
| ------------------- | ---------------------------------------------------------------------------------- |
| `PLAYER` / `TARGET` | targeted player                                                                    |
| `SOURCE` / `SKILL`  | targeting entity                                                                   |
| `LOCATION`          | Player location                                                                    |
| Extra context       | `target_reason`, `target_count`; cancelling removes the remembered target relation |

## `on-untag`

Supported `count`: `events`.

Runs when an entity that was remembered as targeting a player changes to a non-player or clears its target.

| Context             | Value                                    |
| ------------------- | ---------------------------------------- |
| `PLAYER` / `TARGET` | previously targeted player               |
| `SOURCE` / `SKILL`  | entity that stopped targeting the player |
| `LOCATION`          | Player location                          |
| Extra context       | `target_reason`                          |

## `on-creeper-explode`

Supported `count`: `events`.

Runs for an explosion-prime event when the priming entity is a player or a creeper currently targeting a player.

| Context             | Value                                                                       |
| ------------------- | --------------------------------------------------------------------------- |
| `PLAYER` / `TARGET` | Player entity, or creeper's current player target                           |
| `SOURCE` / `SKILL`  | Priming entity, normally the creeper                                        |
| `LOCATION`          | Priming entity location                                                     |
| Extra context       | `original_radius`; mutable explosion radius                                 |
| Note                | This is not a generic explosion trigger and does not expose explosion yield |

## `on-enderman-attack-player`

Supported `count`: `events`.

Runs for Paper's Enderman attack-player event when an Enderman checks whether a player is looking directly at it. Cancelling prevents gaze-triggered aggression without preventing retaliation when the player attacks first.

| Context             | Value                                                                         |
| ------------------- | ----------------------------------------------------------------------------- |
| `PLAYER` / `TARGET` | player being checked                                                          |
| `SOURCE` / `SKILL`  | Enderman performing the check                                                 |
| `LOCATION`          | Player location                                                               |
| Extra behavior      | Cancelling prevents the Enderman from becoming hostile because of eye contact |

## `on-phantom-pre-spawn`

Supported `count`: `events`.

Runs for Paper's phantom pre-spawn event when the spawning entity is a player.

| Context                                  | Value                                   |
| ---------------------------------------- | --------------------------------------- |
| `PLAYER` / `SOURCE` / `SKILL` / `TARGET` | player for whom the phantom would spawn |
| `LOCATION` / `BLOCK`                     | Proposed spawn location and its block   |
| Extra behavior                           | Cancelling sets `shouldAbortSpawn`      |

## `on-warden-anger-change`

Supported `count`: `events`.

Runs when Paper reports a Warden anger change whose target is a player.

| Context             | Value                                                                                            |
| ------------------- | ------------------------------------------------------------------------------------------------ |
| `PLAYER` / `SOURCE` | player who is the Warden's anger target                                                          |
| `SKILL` / `TARGET`  | Warden                                                                                           |
| `LOCATION`          | Warden location                                                                                  |
| Extra context       | Old/new anger values remain on `WardenAngerChangeEvent`; mutable `warden_anger` modifier context |

## `on-shear`

Supported `count`: `events`. Runs once per matching entity-shearing event. Filter `TARGET` to distinguish sheep (`SHEEP`), mooshrooms (`MOOSHROOM`), and other supported entities. `PLAYER` / `SOURCE` is the player, `TARGET` is the sheared entity, and `LOCATION` is its location. The trigger item and slot are the actual shears and hand. Leash cutting uses the separate `cut_leash` trigger.

## `on-cut-leash`

Supported `count`: `events`. Runs when a player cuts a leash with shears, once per unleashed entity. `PLAYER` / `SOURCE` is the player, `TARGET` is the unleashed entity, and `LOCATION` is its location. The trigger item and slot are the actual shears and hand. Empty-hand unleashing does not trigger it. Requires a server version that supports leash cutting and emits the corresponding player unleash event. Both triggers are available on Paper and Spigot; cancelled events do not count.

## `on-breed`

Supported `count`: `events`. Runs once per matching breeding event attributed to a player. `PLAYER` / `SOURCE` is the recorded breeder; `TARGET` is the newborn entity; `LOCATION` is the newborn's location. Use target entity matching to restrict the animal type.

The trigger item is the recorded breeding item, if present. The event does not supply the original feeding slot, so the slot is absent. Events without a player breeder and cancelled events do not count. Available on Paper and Spigot; animal and breeding coverage depends on the server emitting `EntityBreedEvent`.

## `on-tame`

Supported `count`: `events`. Runs once when a player successfully tames an entity. `PLAYER` / `SOURCE` is the owner, `TARGET` is the tamed entity, and `LOCATION` is its location. Use target entity matching to restrict species. Failed attempts, non-player owners, and cancelled events do not count. The event does not provide the exact taming item or hand, so trigger-item data is absent. Available on Paper and Spigot.
