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

# Building a Boss

> A complete two-phase boss, built step by step from everything in the Effects section.

Everything in the Effects section, stitched into one complete boss. This page builds the **Toast King** step by step: a two-phase boss with a telegraphed AoE, an enrage at half health, minions and rewards.

## Step 1: The mob

Start with the body: model, base entity and stats.

```yaml theme={null}
# Mobs/toast_king.yml
toast_king:
  model: toast
  base: zombie
  display: "&6&lToast King"
  health: 300
  damage: 8
  armor: 10
  scale: 2.0
  persistent: true
```

`/nme reload`, `/nme spawn toast_king`. It exists, it hits hard, it does nothing interesting yet.

## Step 2: An entrance

Spawn and death moments use [`@world`](targeter-world) so everyone knows what's happening.

```yaml theme={null}
  effects:
  - sound{sound=entity.wither.spawn;volume=2}  #onSpawn @world
  - narrate "&4The Toast King has awakened..." #onSpawn @world
  - narrate "&aThe Toast King has fallen!"     #onDeath @world
```

## Step 3: The signature attack

A telegraphed shockwave as a [local effect](named-effects), driven by a [`repeat`](timers-auras). Warn wide, hit narrow, with a [`delay`](flow-control) between the two.

```yaml theme={null}
  effects:
  # ...previous lines...
  - repeat{effect=shockwave;every=3s;for=forever;name=quake} #onSpawn @self
  - stoprepeat{name=quake}                                   #onDeath @self
  shockwave:
  - particlering{particle=flame;radius=5;points=48} @self
  - sound{sound=block.bell.use;volume=2} @playersRadius[20]
  - delay 0.5s
  - particlering{particle=explosion;radius=5;points=24} @self
  - damage{amount=8}   @playersRadius[5]
  - push{velocity=1.2} @playersRadius[5]
```

Every 3 seconds: flame ring and a bell, half a second to get out, then the blast.

## Step 4: The enrage

A phase flip at half health, guarded by a [variable](variables) so it only fires once. `health` comes from the [condition language](flow-control).

```yaml theme={null}
  effects:
  # ...previous lines...
  - if{cond=health <= 150 && var.phase != 2;then=enrage} #onHurt @self
  enrage:
  - var{phase=2}
  - setname{name=&4&lEnraged Toast King} @self
  - setspeed{amount=0.45} @self
  - glow{glowing=true} @self
  - sound{sound=entity.ender_dragon.growl;volume=2} @playersRadius[30]
  - summon{mob=toast_minion;amount=3;radius=4} @self
```

Without the `var.phase != 2` guard, the enrage would re-fire on every hit below half health, summoning minions forever.

## Step 5: The payoff

Reward the killer directly, drop contested loot for everyone else.

```yaml theme={null}
  effects:
  # ...previous lines...
  - giveitem{item=diamond;amount=5}        #onDeath @target
  - dropitem{item=golden_apple;amount=3}   #onDeath @self
  - lightning                              #onDeath @self
```

## The full file

```yaml theme={null}
# Mobs/toast_king.yml
toast_king:
  model: toast
  base: zombie
  display: "&6&lToast King"
  health: 300
  damage: 8
  armor: 10
  scale: 2.0
  persistent: true
  effects:
  - sound{sound=entity.wither.spawn;volume=2}  #onSpawn @world
  - narrate "&4The Toast King has awakened..." #onSpawn @world
  - repeat{effect=shockwave;every=3s;for=forever;name=quake} #onSpawn @self
  - if{cond=health <= 150 && var.phase != 2;then=enrage} #onHurt @self
  - stoprepeat{name=quake}                     #onDeath @self
  - narrate "&aThe Toast King has fallen!"     #onDeath @world
  - giveitem{item=diamond;amount=5}            #onDeath @target
  - dropitem{item=golden_apple;amount=3}       #onDeath @self
  - lightning                                  #onDeath @self
  shockwave:
  - particlering{particle=flame;radius=5;points=48} @self
  - sound{sound=block.bell.use;volume=2} @playersRadius[20]
  - delay 0.5s
  - particlering{particle=explosion;radius=5;points=24} @self
  - damage{amount=8}   @playersRadius[5]
  - push{velocity=1.2} @playersRadius[5]
  enrage:
  - var{phase=2}
  - setname{name=&4&lEnraged Toast King} @self
  - setspeed{amount=0.45} @self
  - glow{glowing=true} @self
  - sound{sound=entity.ender_dragon.growl;volume=2} @playersRadius[30]
  - summon{mob=toast_minion;amount=3;radius=4} @self
```

One file, one boss. The only external piece is `toast_minion`, a second mob for the summons: any simple mob entry works.

## Ideas to build on

* Make the shockwave faster in phase 2: stop `quake` in `enrage` and start a new repeat with `every=1.5s`.
* Add a rare drop with `if{cond=random < 0.1;then=rare_drop}` on death.
* Give the enrage a [particle equation](particle-equations) aura so the phase is visible from across the arena.
