> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nmentities.net/llms.txt
> Use this file to discover all available pages before exploring further.

# What are Targeters

> Targeters decide who an effect applies to.

A targeter decides **who** an effect line applies to. It's the part prefixed with `@`:

```yaml theme={null}
- damage{amount=6}  #onHurt  @target
```

If a line has no targeter, it defaults to `@self`.

## Available targeters

| Targeter                                         | Resolves to                                  |
| ------------------------------------------------ | -------------------------------------------- |
| [`@self`](targeter-self)                         | the mob itself (default)                     |
| [`@target`](targeter-target)                     | the entity that caused the trigger           |
| [`@playersRadius[N]`](targeter-players-radius)   | players within `N` blocks of the mob         |
| [`@entitiesRadius[N]`](targeter-entities-radius) | living entities within `N` blocks            |
| [`@mobsRadius[N]`](targeter-mobs-radius)         | living non-player entities within `N` blocks |
| [`@world`](targeter-world)                       | every player in the mob's world              |

## One effect, many targets

A targeter can resolve to zero, one, or many entities. The mechanic runs once **per target**:

```yaml theme={null}
- damage{amount=8} @playersRadius[5]   # every player within 5 blocks takes 8 damage
- narrate "&cRun!" @playersRadius[20]  # every player within 20 blocks gets the message
```

If a targeter resolves to nothing (no players in range, no attacker on environmental damage), the line simply does nothing. That's normal and not an error.

## Player-only mechanics

Some mechanics only make sense for players. Chat messages, action bars, titles and item gives silently skip non-player targets:

```yaml theme={null}
- narrate "hello" @entitiesRadius[10]  # only the players among them see it
```

## Targeters in named effects

Lines inside a [named effect](overview) can carry their own targeter. If they don't, they inherit the targets of the line that called them:

```yaml theme={null}
  effects:
  - run smash  #onHurt @target      # smash runs against the attacker...
  smash:
  - lunge{velocity=1.6}             # ...this line inherits @target
  - damage{amount=10} @playersRadius[4]  # ...this one overrides it
```
