> ## Documentation Index
> Fetch the complete documentation index at: https://entities.lodemc.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/toast_king.yml
toast_king:
  model: toast
  base: zombie
  display: "&6&lToast King"
  health: 300
  damage: 8
  armor: 10
  scale: 2.0
  persistent: true
```

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

## Step 2: An entrance

Spawn and death moments use [`@world`](targeters) (every player in the world, short for `@playersInWorld`) 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](https://entities.lodemc.net/named-effects.md), 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](https://entities.lodemc.net/variables.md) so it only fires once. `health` comes from the [condition language](https://entities.lodemc.net/conditions.md#combining-them).

```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 (`@trigger` on `+onDeath` is the killer), drop contested loot for everyone else.

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

## The full file

```yaml theme={null}
# Mobs/toast_king/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 @trigger
  - 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, in its own folder beside `toast.bbmodel`. 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 `dropitem{items=nether_star 1 0.1} +onDeath @selfLocation`: the last number is a 10% chance.
* Fire the shockwave on the frame its slam animation lands, with an `effect:shockwave` keyframe; see [Animating Your Model](https://entities.lodemc.net/animating-a-model.md#effects-on-an-animation-frame).
* Tag the enrage on the line itself instead of a variable: `- skill{s=enrage} +onHurt <50%` runs only below half health. Add `cooldown=9999` (or a `var` guard) so it fires once. See [Line Options](https://entities.lodemc.net/line-options.md).
* Give the enrage a [particle equation](https://entities.lodemc.net/particle-equations.md) aura so the phase is visible from across the arena.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.