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

# Timers & Auras

> Run effects on a timer with repeat, pulse and stoprepeat.

To run an effect on a timer, use `repeat`: say what to run, how often, and for how long. This is how auras, pulsing attacks and phase timers are built.

```yaml theme={null}
- repeat{effect=shockwave;every=2s;for=30s} #onSpawn @self
- repeat{effect=heal_aura;every=1s;for=forever}
```

## repeat

Runs a [named or local effect](named-effects) on each target repeatedly.

**Alias:** `every`

| Attribute | Default  | Description                                         |
| --------- | -------- | --------------------------------------------------- |
| `effect`  | required | The named or local effect to run.                   |
| `every`   | `1s`     | How often it runs.                                  |
| `for`     | `5s`     | How long it keeps going, or `forever`.              |
| `name`    |          | A name so you can stop it later.                    |
| `onStart` |          | Optional effect to run once when the repeat starts. |
| `onEnd`   |          | Optional effect to run once when it ends.           |

The repeating effect runs with the ticking entity as `@self`, so radius targeters inside it resolve around that entity. Repeats stop automatically when the entity dies or despawns.

## stoprepeat

Stops repeats and pulses on the targets, running their `onEnd` if they have one.

**Aliases:** `removepulse`, `removeaura`

| Attribute | Description                                  |
| --------- | -------------------------------------------- |
| `name`    | Which repeat to stop. Omit to stop them all. |

```yaml theme={null}
- stoprepeat{name=quake} #onDeath @self
```

## pulse

The full-lifecycle form of `repeat`. Same engine, all three hooks explicit.

**Alias:** `aura`

| Attribute  | Description                          |
| ---------- | ------------------------------------ |
| `onStart`  | Effect to run when the pulse begins. |
| `onTick`   | Effect to run every interval.        |
| `onEnd`    | Effect to run when it ends.          |
| `interval` | Time between ticks.                  |
| `duration` | Total lifetime.                      |
| `name`     | Name for stopping it.                |

## The name pattern

Give a repeat a `name` when anything might need to stop it early: phase changes, death, a cleanse mechanic.

```yaml theme={null}
toast_king:
  model: toast
  base: zombie
  effects:
  - repeat{effect=shockwave;every=2s;for=forever;name=quake} #onSpawn @self
  - stoprepeat{name=quake}                                   #onDeath @self
  shockwave:
  - particlering{particle=flame;radius=5;points=48} @self
  - delay 0.5s
  - damage{amount=8} @playersRadius[5]
```

A `forever` repeat with no `stoprepeat` still ends when the mob dies, but stopping it explicitly also fires its `onEnd`, which matters once you use one.
