> For the complete documentation index, see [llms.txt](https://paw-studio.gitbook.io/paw-studio-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://paw-studio.gitbook.io/paw-studio-docs/litedungeon/dungeon-configuration/dungeon.md).

# 🏰Dungeon

## Dungeon Structure

Key dungeon mechanics and data structure.

#### Dungeon Configs

All configs are stored in:

```
LiteDungeon/configs/dungeons/
```

Each dungeon may contain:

1. **`.yml`** — rules, settings and dungeon information.
2. **`.schem`** — structure schematic, used for `STRUCTURE` dungeons.
3. **World** — `WORLD` dungeons create a separate world in: `server/world/dimensions/minecraft/`

#### Dungeon Data

When a dungeon is created, instance data is stored in:

```
LiteDungeon/data/dungeons/
```

It contains:

* Progress
* Trigger states
* Entities
* Other instance data

Progress is preserved after server restarts.

A `.schem` backup is also created containing the original terrain replaced by the dungeon. After completion, the original terrain is restored.

#### Player Locations

```
LiteDungeon/data/latest_location.yml
```

Stores the locations of players teleported to `WORLD` dungeons. Players return to their original location after completing the dungeon.

## Dungeon Configuration

#### Display Item

Menu icon and name:

```yml
display_item:
  material: CAULDRON
  display_name: <dark_green>Swamp Hut
```

#### Type

```
type: STRUCTURE
```

* `STRUCTURE` — temporarily placed structure.
* `WORLD_STRUCTURE` — separate optimized world for the dungeon.

#### Environment

```
environment: NORMAL
```

Used for `WORLD_STRUCTURE` dungeons:

```
NORMAL
NETHER
THE_END
```

#### Generator

```
generator: FLAT
```

* `VOID` — empty world.
* `FLAT` — flat world, `NORMAL` only.

#### Timer

```yml
timer:
  time: 60
  text_config:
    backgroundOpacity: 0.2
    offsetY: 1
    text:
      - '<dark_green><bold>Swamp Hut'
      - ' '
      - '<gray>Difficulty: <yellow>★☆☆☆☆'
      - '<green>✔ <white>%status%'
  bossbar_config:
    title: '%dungeon_name% <1>Time Left: <2>%time%'
    color: RED
    style: SOLID
```

* `time` — dungeon duration. For `STATIC`, regeneration delay after completion.
* `text_config` — Text Display at `spawn_location`.
* `bossbar_config` — dungeon timer display.

#### Offset

```
offset: -5
```

Y-axis offset of the dungeon. Used to move the dungeon below or above the detected terrain level.

#### Size

```yml
size:
  x: 7
  y: 5
  z: 9
```

Region size. The original area is saved before placing the dungeon and restored after completion.

#### Treasure Map [🗺️Treasure Map](/paw-studio-docs/litedungeon/dungeon-configuration/treasure-map.md)

#### Rules [⚡Rules](/paw-studio-docs/litedungeon/dungeon-configuration/rules.md)

#### Flags [🚩Flags](/paw-studio-docs/litedungeon/dungeon-configuration/flags.md)

#### Spawn Location

```yml
spawn_location:
  vector:
    x: 3
    y: 0
    z: -3
```

Player spawn position relative to the dungeon's minimum point.
