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

# Skills

> Reusable lists of effect lines: inside a mob or anywhere in Mobs/, with gates, cooldowns and parameters.

A skill is a named list of effect lines that other lines call: with `skill` (or its short form `run`), `repeat{effect=…}`, `randomskill`, an `if` or `loop` body, an aura's hooks or a projectile's `onHit`. MythicMobs calls them metaskills; older LodeEntities docs called them named effects. They're the same thing.

## Where skills live

**Inside a mob.** Any extra list key on a mob is a skill. The whole boss stays in one place:

```yaml theme={null}
angry_toast:
  model: toast
  base: zombie
  effects:
  - skill{s=tantrum} +onHurt @trigger
  tantrum:                      # a skill: just another key on the mob
  - effect:explosion @self
  - damage{amount=4} @playersRadius[3]
```

**At the top of any file in `Mobs/`.** A top-level key holding a list of lines is a skill. Put shared skills wherever suits you, for example `Mobs/shared/`:

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

**Every skill is global**, wherever it is written: a skill inside one mob can be called by another. A mob calling a name it defines itself always gets its own; when two mobs define the same name, [`/le debug`](debug) warns about it. Skills load with everything else in `Mobs/` and reload with `/le reload` (`Loaded N skill(s) from Mobs/.`).

## The section form

Wrap the lines in `effects:` (MythicMobs' `Skills:` works too) and the skill can carry options:

```yaml theme={null}
check_minions:
  cooldown: 10                          # seconds before it can run again for the same caster
  conditions:                           # a gate, checked against the caster
  - "mobsInRadius{types=crypt_minion;a=1to20;r=24}"
  conditions-else: no_minions_left      # run this instead when the gate fails
  effects:
  - actionbar{m=&7The minions are up} @playersRadius[24]
```

| Key | What it does |
| :- | :- |
| `effects` | The lines. |
| `cooldown` | Seconds before it can run again for the same caster. |
| `conditions` | Asked about the caster before anything runs: a list that must all pass, or one expression (`conditions: moving && !isNight`). See [Conditions](https://entities.lodemc.net/conditions.md#gating-a-skill). |
| `target-conditions` | Filters the targets: each must pass. |
| `trigger-conditions` | Asked about the trigger entity. |
| `conditions-else` | A skill to run instead when `conditions` fail. MythicMobs' `orElseCast`. |
| `on-cooldown` | A skill to run instead while it is on cooldown. |
| `on-fail` | A skill to run when its conditions fail. |
| `cancel-if-no-targets` | Skip the skill when the calling line's targeter finds nobody. On by default; `false` runs it anyway. |

MythicMobs' spellings (`Cooldown`, `Conditions`, `TargetConditions`, `TriggerConditions`, `OnCooldownSkill`, `FailedConditionsSkill`, `CancelIfNoTargets`) are read as written. A skill inside a mob is a bare list, so it has nowhere to put these; move it to the top level when it needs a gate.

## Parameters

Anything extra on the calling line becomes a parameter, read inside the skill as `<skill.NAME>`:

```yaml theme={null}
  effects:
  - skill{s=bolt;damage=12;color=red} +onAttack @target
  bolt:
  - damage{a=<skill.damage>}
  - particle{p=dust;color=<skill.color>;a=20}
```

## Lines inside a skill

Lines in a skill take a mechanic and an optional targeter, but **no trigger**: the trigger is on the calling line.

```yaml theme={null}
  effects:
  - skill{s=smash} +onHurt @trigger      # the trigger lives here
  smash:
  - lunge{velocity=1.6}                  # inherits @trigger from the caller
  - delay 0.5s
  - damage{amount=10} @playersRadius[4]  # picks its own targets
```

A line with no targeter inherits the caller's targets; a line with its own `@` overrides them. A `delay` inside a skill pauses that skill only.

> [!NOTE]
>
> Effect lines are quoted when they load, so the old `#onHurt` triggers keep working. The side effect is that a trailing `# comment` on an effect line is part of the line. Put comments on their own line.

## Entry types

An entry in `Mobs/` can say what it is with `type:`. Leave it out and the loader works it out: a section with `base:` is a mob, a list is a skill.

| `type:` | Also | What the entry is |
| :- | :- | :- |
| `mob` | | A [mob](https://entities.lodemc.net/mob-fields.md). The default for a section with `base:`. |
| `npc` | | A mob that is an [NPC](https://entities.lodemc.net/npcs.md). |
| `effect` | `function`, `skill`, `lines` | A skill. The default for a list. |
| `spawn` | `spawnrule`, `naturalspawn` | A [natural spawn rule](https://entities.lodemc.net/natural-spawns.md). |

The top-level key `spawners:` is reserved for a block of [spawners](https://entities.lodemc.net/spawners.md).

## When to use which

* **Inside the mob** for anything specific to it: its attacks, its phases.
* **Top level** for anything shared, or anything that needs a cooldown or a gate.
* **An inline block** for a short one-off branch inside an `if`, `loop` or `while`. See [Flow Control](https://entities.lodemc.net/flow-control.md#bodies-named-effects-or-inline-blocks).

## Testing a skill

[`/le effect start <skill>`](effect-start) runs any skill with you as the caster, without setting up a mob.


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