# 📁 Mode Configuration

## Example Mode

Each mode has its own file inside the `modes` folder. The example below is trimmed: the `display` item and the scoreboard's animated header are both much longer in a real file.

```yaml
sort-order: 1
enabled: true
identifier: crystal
display-name: Crystal
display-description:
- This is a custom arena mode.
display:
  ==: org.bukkit.inventory.ItemStack
  id: minecraft:end_crystal
  count: 1
allowed-player-type:
- UNRANKED_SOLO
- UNRANKED_DUO
- RANKED_SOLO
- RANKED_DUO
- CUSTOM_SOLO
- SOLO_CHALLENGE
- PARTY_CHALLENGE
- PARTY_FFA
- PARTY_TEAM_FIGHT
loadout:
  type: PREMADE_KIT
  kit-id: crystal
scoreboard:
  enabled: true
  header-frames:
  - '&5&lPHOENIX DUELS'
  - '&d&lP&5&lHOENIX DUELS'
  lines:
  - ''
  - '&fTime Left: &a%time_left%'
  - ''
  - '&f%opponents%'
  - ''
  - '&fMode: &a%mode%'
  - '&fMap: &a%map%'
rules:
- 'ENDER_PEARL_COOLDOWN;{5}'
permission:
  required: false
  permission: phoenixduels.mode.example
rounds-to-win: 1
pre-fight-delay-seconds: 10
duration-seconds: 300
cooldown-seconds: 0
public-broadcast: true
commands:
  when-starting: []
  when-ending: []
  when-winning: []
  when-losing: []
```

## Options

<table data-full-width="true"><thead><tr><th width="270">Option</th><th>Description</th></tr></thead><tbody><tr><td>sort-order</td><td>Where this mode sits in the mode menus. Lower numbers come first.</td></tr><tr><td>enabled</td><td>Whether players can play it. A disabled mode stays visible in the editor.</td></tr><tr><td>identifier</td><td>The mode's unique id. Used by placeholders, commands and a map's <code>allowed-modes</code>.</td></tr><tr><td>display-name</td><td>The name players see.</td></tr><tr><td>display-description</td><td>The lore shown under the mode in the menus.</td></tr><tr><td>display</td><td>The item shown for this mode in menus. Written by the editor.</td></tr><tr><td>allowed-player-type</td><td>Which kinds of match may use this mode. Remove an entry to block it.</td></tr><tr><td>loadout</td><td>What players fight with. See below.</td></tr><tr><td>scoreboard</td><td>This mode's own scoreboard. New modes start from <a href="README.md#templates">templates.yml</a>.</td></tr><tr><td>rules</td><td>The <a href="../../main-features/create-a-mode/README.md">gamemode rules</a> applied, with their settings in braces.</td></tr><tr><td>permission</td><td>Set <code>required</code> to true to restrict the mode to holders of <code>permission</code>.</td></tr><tr><td>rounds-to-win</td><td>The rounds value. What it means depends on the server's <code>match.rounds-format</code> setting.</td></tr><tr><td>pre-fight-delay-seconds</td><td>The countdown before the fight starts.</td></tr><tr><td>duration-seconds</td><td>How long a round may run before it is called.</td></tr><tr><td>cooldown-seconds</td><td>How long a player must wait before playing this mode again. <code>0</code> means no cooldown.</td></tr><tr><td>public-broadcast</td><td>Announce the result of every match in this mode to the server.</td></tr><tr><td>commands</td><td>Commands run by the console at each stage of a match.</td></tr></tbody></table>

## Loadout

`loadout.type` decides what players are given when the match starts:

* **PREMADE_KIT** - everyone fights with the kit named by `kit-id`, which points at a file in the `kits` folder.
* **PLAYER_INVENTORY** - players fight with whatever they are already carrying. `kit-id` is not used.

Add-ons register more types. Player Kits adds PLAYER_KIT and SHARED_PLAYER_KIT.

## Player Types

`allowed-player-type` controls both the team sizes and the kinds of match this mode appears in.

<table data-full-width="true"><thead><tr><th width="330">Value</th><th>Allows</th></tr></thead><tbody><tr><td>UNRANKED_SOLO / DUO / TRIO / QUAD</td><td>Unranked queue at 1v1, 2v2, 3v3 and 4v4.</td></tr><tr><td>RANKED_SOLO / DUO / TRIO / QUAD</td><td>Ranked queue at the same sizes.</td></tr><tr><td>CUSTOM_SOLO / DUO / TRIO / QUAD</td><td>Custom matches at the same sizes.</td></tr><tr><td>SOLO_CHALLENGE</td><td>A direct <code>/duel</code> between two players.</td></tr><tr><td>PARTY_CHALLENGE</td><td>One party challenging another.</td></tr><tr><td>PARTY_FFA</td><td>A free-for-all inside one party.</td></tr><tr><td>PARTY_TEAM_FIGHT</td><td>Splitting one party into two teams.</td></tr><tr><td>PARTY_MULTI_TEAM_FIGHT</td><td>Splitting one party into up to four teams. Off by default on new modes.</td></tr></tbody></table>

> **Info:**
`PARTY_MULTI_TEAM_FIGHT` also needs the map to have third and fourth team spawn positions defined, otherwise there is nowhere to put the extra teams.

Source: https://www.phoenixplugins.com/docs/phoenix-duels/configurations/configuration-files/mode-configuration