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

# Levels

> Where a mob's level comes from, and what reads it.

Every mob LodeEntities spawns carries a **level**. It defaults to `1` and is recorded on the entity, so it survives restarts and unloaded chunks.

> [!WARNING]
>
> Levels are recorded and readable, but **nothing scales stats by them yet**. Per-level health and damage formulas are their own feature. Configs written against levels keep working, and an addon can do its own scaling from the value today.

## Where a level comes from

| Source | How |
| :- | :- |
| [Spawners](https://entities.lodemc.net/spawners.md) | `spawn.level` (also `level`, `moblevel`) on the spawner. |
| [Natural spawn rules](https://entities.lodemc.net/natural-spawns.md) | `level` on the rule. |
| The [`summon`](mechanics-world) mechanic | its `level` option. |
| An effect line | `setlevel{action=SET;level=5}` changes it on a live mob. |
| Anything else | `1`: `/le spawn`, the menu, eggs, the API. |

## Scaling by distance

A spawner with `world-scaling: true` sets the level from how far out it is instead of a fixed number — the further from world spawn, the higher the level.

```yaml theme={null}
  spawn:
    world-scaling: true
```

Tuned server-wide in `config.yml`:

```yaml theme={null}
spawner:
  world-scaling:
    blocks-per-level: 250   # blocks from world spawn worth one extra level
    max-level: 20           # ceiling, however far out the spawner is
```

A spawner 1,400 blocks out with the defaults spawns level 6 mobs.

## Reading a level

In any effect text — messages, titles, `setname`, `command`:

```yaml theme={null}
- actionbar{message=&7Level <caster.level> <caster.name>} +onSpawn @playersRadius[16]
- message{m=&cYou were killed by a level <caster.level>!} +onAttack @target
```

| Placeholder | Resolves to |
| :- | :- |
| `<caster.level>` | the mob's own level |
| `<target.level>` | the level of the entity the line is acting on |

Both read `1` for anything that was not spawned with a level.

The `level` [condition](https://entities.lodemc.net/conditions.md) tests it: `?level{l=>5}`. From code, `LodeEntitiesAPI.spawners().levelOf(entity)` returns the same value — see [Spawners](https://entities.lodemc.net/addon-spawners.md#levels) in the API section.


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