> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rpg-leveling.zuxaw.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Instance Level Config

> InstanceLevelConfig.json - Instance/dungeon level mapping and entity overrides.

# Instance Level Config

**File:** `mods/Zuxaw_RPGLeveling/InstanceLevelConfig.json`

This file defines **level ranges and entity overrides for instances and dungeons** - places where zone/biome are unknown or where you want a **per-world** level range (e.g. instanced dungeons, multiworld). When a player or mob is in a world that matches an instance entry, the plugin uses this config for:

* **Mob level calculation** - Monsters get levels within the instance's `LevelMin`–`LevelMax` range
* **HUD display** - The HUD shows the instance id and level range (e.g. *"Yungs\_HyDungeons\_Skeleton\_Dungeon (Lvl 55–75)"*) and uses the same color logic as zones (green/white/orange/red by level gap)
* **XP and entity overrides** - Per-instance entity overrides (e.g. boss level/XP) are checked first; global `ZoneLevelConfig` entity overrides are used as fallback

**Instance overrides zone (multiworld):** For worlds that match an entry in `InstanceLevelConfig`, the **instance level range and entity overrides always take precedence** over `ZoneLevelConfig`. So you can have a main world using zones (Emerald Grove, Howling Sands, etc.) and separate dungeon/minigame worlds each with their own level range in `InstanceLevelConfig.json`. The old built-in "default" (1–25) entry was removed; the default config includes an example (e.g. Yungs\_HyDungeons\_Skeleton\_Dungeon 55–75). Add or edit entries for your instance/dungeon worlds.

***

## Instance Configuration Fields

Instances are defined under the top-level `Instances` array with PascalCase keys:

| Field                | Type    | Description                                                                                                                                                                                                                                                                                                                                                                           |
| -------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Id`                 | String  | Full instance id (e.g. `Yungs_HyDungeons_Skeleton_Dungeon`). Matching depends on `ExactIdMatch`: exact normalized match, or include (game id contains this id).                                                                                                                                                                                                                       |
| `LevelMin`           | Integer | Minimum monster level for this instance.                                                                                                                                                                                                                                                                                                                                              |
| `LevelMax`           | Integer | Maximum monster level for this instance.                                                                                                                                                                                                                                                                                                                                              |
| `EntityOverrides`    | Array   | Per-entity overrides for this instance only (same structure as ZoneLevelConfig: `EntityId`, `Level`, `DisableLevelScaling`, `XP`). Instance overrides take precedence over global `ZoneLevelConfig` entity overrides.                                                                                                                                                                 |
| `DisableRPGLeveling` | Boolean | If `true` (default: `false`), the plugin is **disabled** for this world/instance: no HUD, no level scaling, no XP, no stat-based modifiers (damage/defense/mining/stamina), no death reset. Use to run specific instances (e.g. a minigame world) without any RPG Leveling impact.                                                                                                    |
| `ExactIdMatch`       | Boolean | If `true` (default), the world id must **match exactly** (after normalization: lowercase, collapse spaces/underscores). If `false`, the plugin uses **include** match: the game’s world id only needs to **contain** the config `Id` (e.g. game returns `instance-MyDungeon-123`, config `Id` is `MyDungeon`). Use `false` when the game adds prefixes/suffixes to the instance name. |

***

## Entity Override Fields

Per-instance entity overrides use the same structure as [ZoneLevelConfig](config-zones):

| Field                 | Type              | Description                                                |
| --------------------- | ----------------- | ---------------------------------------------------------- |
| `EntityId`            | String            | NPC type ID (e.g. `Skeleton_Boss`)                         |
| `Level`               | Integer           | Fixed level for this entity                                |
| `DisableLevelScaling` | Boolean           | If `true`, ignore all bonus stats per level                |
| `XP`                  | Double (optional) | Precise XP amount to award (still multiplied by `RateExp`) |

**Priority:** Instance entity overrides > Global zone entity overrides.

***

## Example Config

The built-in "default" (1–25) entry was removed. The default config includes one example instance (Yungs\_HyDungeons\_Skeleton\_Dungeon 55–75); add or edit entries for your instance/dungeon worlds. Example with an entity override:

```json theme={null}
{
  "Version": "0.2.7",
  "Instances": [
    {
      "Id": "Yungs_HyDungeons_Skeleton_Dungeon",
      "LevelMin": 55,
      "LevelMax": 75,
      "EntityOverrides": [
        {
          "EntityId": "Skeleton_Boss",
          "Level": 80,
          "DisableLevelScaling": false,
          "XP": 8000.0
        }
      ],
      "DisableRPGLeveling": false,
      "ExactIdMatch": true
    },
    {
      "Id": "Yungs_HyDungeons_Dragon_Lair",
      "LevelMin": 85,
      "LevelMax": 100,
      "EntityOverrides": [
        {
          "EntityId": "Dragon_Ancient",
          "Level": 150,
          "DisableLevelScaling": true,
          "XP": 50000.0
        }
      ],
      "DisableRPGLeveling": false,
      "ExactIdMatch": false
    }
  ]
}
```

*(In the example above, the second instance uses `ExactIdMatch: false` so the game id only needs to contain `Yungs_HyDungeons_Dragon_Lair`.)*

***

## Adding a New Dungeon

To add a dungeon or modded instance:

1. Find the **instance id** - Check the HUD when inside the dungeon, or look at server logs
2. Add an entry with the **Id**, **LevelMin**, and **LevelMax**
3. Optionally add **EntityOverrides** for bosses or special NPCs

**Example:**

```json theme={null}
{
  "Id": "MyMod_CustomDungeon",
  "LevelMin": 40,
  "LevelMax": 60,
  "EntityOverrides": [
    {
      "EntityId": "CustomDungeon_FinalBoss",
      "Level": 70,
      "DisableLevelScaling": false,
      "XP": 15000.0
    }
  ]
}
```

***

## Removed default entry

The previous built-in **"default"** (1–25) entry has been removed. New configs include an example entry **Yungs\_HyDungeons\_Skeleton\_Dungeon** (LevelMin 55, LevelMax 75, empty EntityOverrides). Add or edit entries for your instance/dungeon worlds as needed.

***

## HUD Display

The HUD shows the instance name and level range with color coding:

| Color                     | Meaning                 | XP       | Action                      |
| ------------------------- | ----------------------- | -------- | --------------------------- |
| **White**                 | Too easy (−26+ levels)  | 10%      | Move to harder content      |
| **Green**                 | Good match (±25 levels) | 100–150% | **Stay here**               |
| **Orange / Red / Purple** | Too hard (+26+ levels)  | 20–50%   | Come back when higher level |

**Example HUD display:** `Yungs_HyDungeons_Skeleton_Dungeon (Lvl 55–75)` in green text.

***

## Monster Level Variation

Just like zones, monsters in instances have **±5 level variation** around their base level for variety.

***

## Use Cases

### Dungeon with Boss Override

Set a skeleton dungeon with a level 80 boss:

```json theme={null}
{
  "Id": "Yungs_HyDungeons_Skeleton_Dungeon",
  "LevelMin": 55,
  "LevelMax": 75,
  "EntityOverrides": [
    {
      "EntityId": "Skeleton_Boss",
      "Level": 80,
      "DisableLevelScaling": false,
      "XP": 8000.0
    }
  ]
}
```

### High-Level End-Game Dungeon

Create an extreme difficulty dungeon with a level 150 boss:

```json theme={null}
{
  "Id": "EndGame_UltimateDungeon",
  "LevelMin": 95,
  "LevelMax": 100,
  "EntityOverrides": [
    {
      "EntityId": "UltimateBoss",
      "Level": 150,
      "DisableLevelScaling": true,
      "XP": 100000.0
    }
  ]
}
```

***

## Troubleshooting: Custom instance config doesn't apply

Sometimes your instance level range or entity overrides do not apply even though you added an entry in `InstanceLevelConfig.json`. A common cause is that **the game uses a non-static instance id**: the world id can include a prefix and a unique suffix (e.g. a UUID), so it never matches your config `Id` exactly.

**Example:** You set `"Id": "MJ_Instance_D01"` but the game reports the world as `instance-MJ_Instance_D01-d63515ea-a4ed-4f3b-a984-5606fb656dc3`. With the default `ExactIdMatch: true`, the plugin requires an exact match (after normalization), so your config is ignored.

**Fix:** For that instance entry, set **`ExactIdMatch`** to **`false`**. Then the plugin matches by **include**: the game id only needs to **contain** your config `Id` (e.g. `MJ_Instance_D01`). So `instance-MJ_Instance_D01-d63515ea-a4ed-4f3b-a984-5606fb656dc3` will match.

In `InstanceLevelConfig.json`, find the instance and set:

```json theme={null}
"ExactIdMatch": false
```

After editing, use **[/lvl reload](commands#lvl-reload)** to apply without restarting.

***

## File location and reload

* **Path:** `mods/Zuxaw_RPGLeveling/InstanceLevelConfig.json`
* To apply changes without restarting, use **[/lvl reload](commands#lvl-reload)** (`rpgleveling.command.reload`). See [Configuration Overview](config-overview#reloading-config).

***

## See Also

* [Configuration Overview](config-overview) - All config files
* [Disable mod for a specific world/instance](disable-per-world) - Guide to using **DisableRPGLeveling**
* [Zone Config](config-zones) - Zone level mapping
* [Dungeon Mod Setup](dungeon-mod-setup) - Step-by-step guide for dungeons
* [Override entity xp and level](override-for-mod) - Override entities from any mod
