> ## 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.

# Named Effects

> Reusable effect sequences: local to a mob or shared in the Effects folder.

Named effects are reusable multi-step sequences, referenced by `run`, `repeat{effect=...}`, `randomskill`, [flow control](flow-control) bodies and pulse hooks. They come in two flavours.

## Local effects

The simplest kind: any extra list key on a mob is an effect private to that mob. No separate file, everything in one place.

```yaml theme={null}
angry_toast:
  model: toast
  base: zombie
  effects:
  - run tantrum #onHurt @target
  tantrum:                      # ← local effect: just another key on the mob
  - fakeexplosion @self
  - damage{amount=4} @playersRadius[3]
```

## Global effects

Files in `Effects/` define effects shared by every mob. Each top-level key is an effect id holding its lines **directly**:

```yaml theme={null}
# Effects/greetings.yml
greeting:
- narrate "&aHello there!"
- narrate "&7(from afar)" @playersRadius[30]
```

Call it from any mob:

```yaml theme={null}
toast_mob:
  model: toast
  base: pig
  effects:
  - run greeting  #onInteract  @target
```

If a mob has a local effect with the same name as a global one, the **local one wins** for that mob. The `Effects/` folder is created on first boot and reloaded by `/nme reload` (`Loaded N effect(s) from Effects/.`).

### The legacy wrapped form

Older effect files wrapped the lines in an `effects:` key. That form still loads identically, in both global files and local effects, so existing configs keep working:

```yaml theme={null}
greeting_wrapped:         # legacy form - loads the same as the direct one
  effects:
  - narrate "&aHello there!"
```

Use the direct form for new effects. One shape everywhere: global effects, local effects, same thing.

The mob's own `effects:` key is the exception on purpose: the trigger-bearing list on a mob always keeps its `effects:` key, since that's what separates mob options from effect lines.

## The rules inside a named effect

Named-effect lines (both kinds) take a **mechanic** and an optional **targeter**, but **no trigger**. The trigger comes from the `run` line on the mob:

```yaml theme={null}
  effects:
  - run smash #onHurt @target    # ← the trigger lives here
  smash:
  - lunge{velocity=1.6}          # ← inherits @target from the caller
  - delay 0.5s
  - damage{amount=10} @playersRadius[4]   # ← overrides with its own targeter
```

A line with no targeter inherits the caller's targets. A line with its own `@` overrides them. A [`delay`](flow-control) inside a named effect pauses that effect only, not the caller.

> Inside an `effects:` list, `#` means *trigger*, so you can't put a trailing `#` comment on an effect line. A `#` on its own line is still a normal YAML comment.

## When to use which

* **Local** for anything specific to one mob: its attacks, its phases. Keeps the whole boss readable in one file.
* **Global** for anything shared: a standard death explosion, a server-wide greeting style, particle shapes you reuse across bosses.
* For short one-off branches inside `if`/`loop`/`while`, an [inline block](flow-control) can replace a named effect entirely.
