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

# How Effects Work

> The effect line: what happens, when, and to whom. Written the same way as MythicMobs skills.

Effects are what a mob **does**: greet a player, hit back, explode on death, fire a homing shard on the third frame of an animation. Each effect is one line with up to three parts:

```text theme={null}
damage{amount=6}   +onHurt   @trigger
└─ mechanic ───┘   └trigger┘ └targeter┘
```

* **Mechanic**: what happens. See [All Mechanics](https://entities.lodemc.net/mechanics.md).
* **Trigger**: when, prefixed `+`. Optional; a line with no trigger runs when the mob spawns. See [Triggers](https://entities.lodemc.net/triggers.md).
* **Targeter**: to whom, prefixed `@`. Optional; a line with no targeter acts on the mob itself. See [Targeters](https://entities.lodemc.net/targeters.md).

> [!NOTE]
>
> The effect language **is** the MythicMobs skill language. Every MythicMobs mechanic, targeter, condition, trigger and placeholder is understood under its MythicMobs name, so a skill line copied from a MythicMobs pack loads as written. See [MythicMobs](https://entities.lodemc.net/mythicmobs.md) for the few deliberate differences.

## Where lines go

On a mob, under `effects:`:

```yaml theme={null}
toast:
  base: zombie
  model: toast
  effects:
  - narrate "&7Sir Toast greets you!" +onInteract @trigger
  - damage{amount=2}                  +onHurt     @trigger
  - lightning                         +onDeath    @self
```

Or in a reusable **skill**: a named list of lines, inside the mob or as a top-level entry in any file in `Mobs/`. A mob calls it with `skill` (or its alias `run`), and the trigger stays on the calling line:

```yaml theme={null}
  effects:
  - skill{s=smash} +onHurt @trigger
  smash:
  - lunge{velocity=1.6}
  - delay 0.5s
  - damage{amount=10} @playersRadius[4]
```

See [Skills](https://entities.lodemc.net/named-effects.md).

## Writing a mechanic

* Options go in braces right after the name, no space: `potion{type=poison;duration=5s;level=1}`.
* Names, aliases and option keys are **case-insensitive**. `Damage{A=5}` is `damage{amount=5}`.
* Message mechanics take a quoted string: `narrate "hi"` is `narrate{message=hi}`.
* **Durations** take units: `40t` (ticks), `2s`, `1.5m`, `500ms`. A bare number in an effect line is ticks.
* **Colours** use `&` codes: `&6Golden`.
* Numbers can be placeholders, ranges and maths: `damage{a=<caster.level>*2}`, `summon{amount=1to3}`.
* Every mechanic also takes the [line options](https://entities.lodemc.net/line-options.md): `delay`, `repeat`, `cooldown`, `chance` and the rest, plus inline `?conditions`.

## The rules worth knowing

* **Changes reach new mobs.** `/le reload`, then spawn a fresh one. Mobs already in the world keep what they were spawned with.
* **A target list can be empty.** A line whose targeter finds nobody does nothing, which is normal: `+onDeath @trigger` after fall damage has no killer.
* **Player-only mechanics skip everyone else.** `narrate @entitiesInRadius{r=10}` reaches only the players among them.
* **One `#` trap.** Effect lines are quoted when they load so that the old `#onHurt` triggers keep working, which means a trailing `# comment` on an effect line is part of the line. Put comments on their own line.

## When a line doesn't work

Run [`/le debug`](debug). Every line that failed to load is listed with its file, its position, the part that is wrong and a suggested fix, including typos (`narrat` → `narrate`) and options a mechanic ignores.

## Where to go next

* [My First Effect](https://entities.lodemc.net/my-first-effect.md) walks through the basics on a real mob.
* [Building a Boss](https://entities.lodemc.net/building-a-boss.md) puts the pieces together into a two-phase fight.


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