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

# Ghost Opponents

Nobody to play? After `queue.ghost-after` seconds without a live rival, a queued player faces the **ghost** of a real player close to their ELO.

* Every ranked duel with at least `ghosts.min-score` blocks (and no forfeit) is recorded: the player's movement, head turns, swings and every broken block, plus the mine layout they mined.
* A ghost duel replays one of those runs in exactly the same layout: a player NPC with their skin and name (`ghost-nametag`), holding `ghosts.held-item` and glowing in `ghosts.glow`, walks, swings and breaks its blocks like they did. Its mine refills exactly when theirs did.
* It is ranked: it costs a token and counts for the player's ELO with `ranked.ghost-k-factor`. Only the player's ELO changes. The daily same-opponent limit includes ghosts.
* Ghosts are picked among the 5 closest in ELO (randomly, so it isn't always the same one), never your own, only from an arena that still exists with the same mine size, and only when recorded with the current `duel.duration`.

| Setting                  | Default          |                                                  |
| ------------------------ | ---------------- | ------------------------------------------------ |
| `ghosts.enabled`         | true             | record and use ghosts                            |
| `ghosts.keep-per-player` | 3                | most recent recordings kept per player           |
| `ghosts.max-total`       | 400              | recordings kept in total (oldest removed first)  |
| `ghosts.min-score`       | 20               | only duels with at least this score are recorded |
| `ghosts.held-item`       | DIAMOND\_PICKAXE |                                                  |
| `ghosts.glow`            | AQUA             | `''` = no glow                                   |

Recordings live in `ghosts/*.ghost` (about 10 KB a minute, compressed). Only their headers stay in memory.

## Admin tools

* `/duel admin replays [player]`: the newest recordings with clickable **\[PLAY] \[WATCH] \[DEL]**.
* `/duel admin replay <id|player> [player]`: race a recording as a practice duel (your own too).
* `/duel admin watchreplay <id|player>`: watch a recording alone from the spectator spot.
* `/duel admin deletereplay <id>`.
