> For the complete documentation index, see [llms.txt](https://realisticnode.gitbook.io/rnsetups/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://realisticnode.gitbook.io/rnsetups/rncombatpvp/configuration/menus.md).

# Menus

Change the layout, items and sounds of every menu in menus.yml, and add your own buttons.

`menus.yml` sets how every menu looks. Texts (titles, names, lore) are in the [language files](/rnsetups/rncombatpvp/configuration/languages.md) under `menus.<menu>`.

| Menu                                      | Opened with                                                                     |
| ----------------------------------------- | ------------------------------------------------------------------------------- |
| `main`                                    | `/combat`                                                                       |
| `stats`                                   | `/combat stats [player]`, **Your stats** in `/combat`, a player in the top list |
| `top`                                     | `/combat top [kills\|kdr\|streak\|rating\|assists]`                             |
| `bounties`                                | `/combatbounty` (or `/bounty`), `/combat bounties`                              |
| `recap`                                   | `/combat recap`, **Last death** in `/combat`                                    |
| `prefs`                                   | `/combat prefs`, **Your settings** in `/combat`                                 |
| `editor`, `editor-options`, `editor-list` | `/combat editor` (admins)                                                       |
| `confirm`                                 | Questions such as "End your newbie protection?"                                 |

```yaml
menus:
  main:
    rows: 5
    filler: GRAY_STAINED_GLASS_PANE   # "" = empty slots stay empty
    content: ""
    items:
      profile: {slot: 4, material: PLAYER_HEAD}
      stats: {slot: 21, material: WRITABLE_BOOK}
      top: {slot: 22, material: GOLD_INGOT, model: 0}
      editor: {slot: 32, material: COMMAND_BLOCK, enabled: false}
```

* `rows`: 1 to 6.
* `slot`: 0 is the top left slot, 8 the top right, 9 the first slot of the second row, and so on.
* `material`: any item.
* `model`: custom model data for resource packs (`0` = none).
* `enabled: false` removes a button.
* `content`: the slots used by lists (top players, bounties, recap lines, editor options), like `"10-16, 19-25"`.

In the `main` menu, `pvp-on` and `pvp-off` share a slot: one or the other shows depending on the player's PvP. Buttons a player can't use (the editor without permission, newbie protection when they don't have it) are not shown.

A slot outside the menu is reported in the console and the default slot is used.

Sounds of clicks, errors, successes, page turns and the countdown are at the top of the file (`sounds`).

<figure><img src="https://i.imgur.com/LLDzr4S.png" alt="The main menu"><figcaption><p>The main menu</p></figcaption></figure>

## Your own buttons

Add buttons that run commands under `custom` of any menu:

```yaml
menus:
  main:
    custom:
      arena:
        slot: 38
        material: NETHERITE_SWORD
        name: "<red><bold>PvP arena"
        lore: ["<gray>Go to the arena"]
        permission: ""
        actions:
          - "[player] warp arena"
          - "[sound] minecraft:entity.experience_orb.pickup"
          - "[close]"
        right-click-actions: []
```

| Key                   | What it does                                                                                                         |
| --------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `slot`                | Where it goes. A custom button never covers a built-in button: turn that one off (`enabled: false`) to free its slot |
| `material`, `model`   | Item and custom model data                                                                                           |
| `name`, `lore`        | Texts (MiniMessage or `&` codes)                                                                                     |
| `permission`          | Needed to see and use it (`""` = everyone)                                                                           |
| `actions`             | What a click does, in order                                                                                          |
| `right-click-actions` | Optional: what a right click does instead                                                                            |

| Action                | What it does                                                                    |
| --------------------- | ------------------------------------------------------------------------------- |
| `[player] <command>`  | Runs a command as the player                                                    |
| `[console] <command>` | Runs a command as the console                                                   |
| `[message] <text>`    | Sends a message to the player                                                   |
| `[menu] <name>`       | Opens a menu of rnCombatPvP: main, stats, top, bounties, recap, prefs or editor |
| `[sound] <sound>`     | Plays a sound (`minecraft:...`)                                                 |
| `[close]`             | Closes the menu                                                                 |
| `[back]`              | Goes back to the menu before                                                    |

Placeholders in commands: `{player}`, `{uuid}`, `{world}`, and PlaceholderAPI placeholders.

{% hint style="warning" %}
In `[console]` commands, the values of placeholders keep only letters, numbers and `_ . : -`; anything else becomes `_`. This way nothing a player chose can add words to a command run by the console.
{% endhint %}

Menus can't be used to take items: every click is cancelled and nothing can be moved in or out.
