> For the complete documentation index, see [llms.txt](https://edseries-plugins.gitbook.io/p/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://edseries-plugins.gitbook.io/p/pinnaduels/setting-up/arenas.md).

# Arenas

An arena is a build with **two mines of the same size** (as seen from each player's spawn), two spawns, a spectator spot and the score panel position. Every arena file in `arenas/<id>.yml` is loaded; a duel picks one at random by `weight`. Each arena is pasted (budgeted per tick, `arena.paste-ms-per-tick`) into copies in the `pinnaduels` void world, `arena.spacing` blocks apart, at most `arena.max-arenas` duels at once. A copy is kept and only its two mines are refilled per duel.

## The bundled arena

A fresh install gets `arenas/duelsmina.yml` and `schematics/duelsmina.schem`: two floating islands, a blue mine to the north and a red one to the south, each 27x27 and 9 deep, with the panel over the gap and an invisible spectator platform to the east. Delete both files, or set `enabled: false`, to stop using it. It is only installed when the `arenas/` folder doesn't exist yet.

## Your own arena with /duel setup

Build the arena in any normal world (not the duels world), then:

1. `/duel setup <id>`: starts the wizard and gives you the wand (a-z, 0-9, `_`, `-`).
2. `/duel setup min` and `/duel setup max`: stand at two opposite corners of the build.
3. With the wand, left and right click the two corners of mine **A**, then of mine **B**. `/duel setup mine a|b` switches which one the wand marks. Particles show what is set.
4. `/duel setup spawn a` and `/duel setup spawn b`: stand where each player starts, **looking into their mine**. Your facing decides the mine's orientation, so mines can face any direction.
5. `/duel setup spectator`: where spectators stand. `/duel setup display`: the score panel floats 1.5 blocks above you.
6. `/duel setup finish`: the region is captured into `schematics/<id>.pinna` and `arenas/<id>.yml` is written. The arena is live at once. `/duel setup info` shows what is set, `/duel setup cancel` stops.

The region can hold up to 16 million blocks. Ghosts only replay in the arena (and mine size) they were recorded in, so changing an arena's mines makes its old recordings unusable.

## An arena from a WorldEdit schematic

PinnaDuels reads `.schem` files itself (Sponge format v1-v3, as saved by WorldEdit and FastAsyncWorldEdit), without WorldEdit installed. Write the arena file by hand:

```yaml
enabled: true
schematic: myarena            # schematics/myarena.pinna if it exists, else myarena.schem
schematic-offset: '-40 64 -60' # added to every schematic block (counted from its corner)
weight: 1
sides:
  a:
    mine: -13 92 -50 13 100 -24   # two opposite corners 'x1 y1 z1 x2 y2 z2'
    spawn: {x: 0.5, y: 101, z: -55.5, yaw: 0, pitch: 12}
  b:
    mine: -13 92 24 13 100 50
    spawn: {x: 0.5, y: 101, z: 56.5, yaw: 180, pitch: 12}
spectator: {x: 75.5, y: 127, z: 0.5, yaw: 90, pitch: 30, platform: true}
display: {x: 0.5, y: 109, z: 0.5}
```

* Coordinates are relative to the arena centre on X/Z and absolute on Y.
* The `.schem` is looked up in `plugins/PinnaDuels/schematics/`, then in WorldEdit's and FastAsyncWorldEdit's `schematics/` folders. Without `schematic-offset` it is centred on X/Z with its bottom layer at Y 64.
* `spectator.platform: true` adds an invisible 5x5 barrier floor with a 2 high rail under the spectator spot.
* Only blocks are read (no chests' contents, entities or biomes). Blocks the server version doesn't know are skipped.
* `/duel admin reload` reloads the arenas; `/duel admin arenas` lists them.

## The generated arena

While no arena file loads, a generated arena is used: two `arena.mine-size` x `arena.mine-size` mines, `arena.mine-depth` deep, `arena.gap` blocks from an invisible `arena.wall-block` (BARRIER) wall, at Y `arena.y`, made of `frame-block`, `floor-block` and `walkway-block`. `arena.keep-default: true` keeps it in the rotation next to your arenas.

## Mine blocks

Every mine (of every arena) is filled from `arena.palette` (block: weight). Both mines of a duel always get the same layout. Keep the blocks the same hardness so no layout is luckier.
