> 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/playing/duels.md).

# How a Duel Plays

Two players mine for `duel.duration` seconds (60 by default) in two identical mines facing each other. They mine with their **own PinnaPrison pickaxe**, which breaks blocks instantly for everyone, so the score is simply the number of blocks mined. The player with more blocks wins.

## Step by step

1. **Match.** Two queued players are matched by ELO (or one player with a [ghost](/p/pinnaduels/playing/ghosts.md)). Both get a title, a sound and a chat line. With `queue.require-accept: true` they first have to click **\[ACCEPT]** (or `/duel accept`) within `queue.accept-seconds`.
2. **Loading.** Ranked duels take one Duel Token from each player (given back if the duel can't start). A free copy of a random arena (by `weight`) is reserved in the `pinnaduels` world, its mine chunks load in the background and both mines are filled with the same random layout, all before anyone is moved.
3. **Arena.** Players land on their spawn, looking into their mine. Their PinnaPrison pickaxe is selected; players without one are lent `duel.fallback-pickaxe` (if the hotbar is full, the last hotbar item is saved to `data/stash/` first and given back after the duel, even after a crash). They are put in survival, can fly with `duel.allow-flight`, and get `duel.haste` if set. Everything is restored afterwards.
4. **Countdown** of `duel.countdown` seconds with titles and sounds, then **MINE!**
5. **Mining.** Only blocks of your own mine count, only with the duel pickaxe. A mine that drops below `duel.refill-below` of its blocks is refilled with the next layout (you are put back on your spawn first). The refill depends only on the blocks that side broke, so both sides and ghosts refill the same way. Falling out or walking off the arena puts you back on your spawn.
6. **Forfeits.** Mining nothing in the first `duel.afk-seconds`, logging out or leaving the duels world forfeits.
7. **Results.** Titles, a chat summary, sounds and (`display.win-particles`) fireworks for the winner. Ranked duels change ELO, stats and leagues and run the rewards; see [Ranked](/p/pinnaduels/playing/ranked.md). The whole server gets a `broadcast-*` message with a clickable **\[JOIN THE QUEUE]** button (practice duels are not announced).
8. After `duel.results` seconds everyone is sent back to the exact spot they came from, also into the private mine they were in or visiting.

A running duel keeps the settings it started with, so `/duel admin reload` never changes its length or rules.

## What players see

* **Score panel** (`display.score-panel`) floating over the arena: a dark glass board that turns to face every viewer, who always sees themselves on the left. Both 3D heads, names, ELO and league, big scores that pop on every block, a highlight and crown gliding to the leader, the countdown / timer (red in the last 10 seconds) and a tug-of-war bar. At the end the winner's head spins and glows and the ELO lines show the change. Colours: `display.colors`; texts: `panel.*` in messages.yml. It is made of plain text and items, no resource pack needed.
* **Boss bar** (`display.boss-bar`): both names and scores with a tug-of-war fill that turns green / red / yellow.
* **Action bar**: your score, theirs, the difference and the time (`actionbar.duel`).

## Duel types

| Type     | How                                 | Tokens | ELO / stats / rewards             | Recorded              |
| -------- | ----------------------------------- | ------ | --------------------------------- | --------------------- |
| Ranked   | the queue                           | 1 each | yes                               | yes (becomes a ghost) |
| Ghost    | the queue, nobody close enough      | 1      | yes (only yours changes)          | no                    |
| Friendly | `/duel <player>`                    | no     | no (cooldown `friendly.cooldown`) | no                    |
| Practice | `/duel admin practice/match/replay` | no     | no                                | no                    |
