> 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/rnpsmenu/configuration/menus.md).

# Menus

Change the layout, items and sounds of every menu in menus.yml.

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

```yaml
menus:
  main:
    rows: 5
    filler: GRAY_STAINED_GLASS_PANE   # '' = empty slots stay empty
    items:
      owned: {slot: 19, material: GRASS_BLOCK}
      shop: {slot: 23, material: EMERALD, model: 0}
      admin: {slot: 36, material: COMMAND_BLOCK, enabled: false}
  regions:
    rows: 6
    content: 10-16, 19-25, 28-34, 37-43   # slots for the list
```

* `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. Buttons that show something specific (region blocks, player heads) keep their own item.
* `model`: custom model data for resource packs.
* `enabled: false` removes a button.
* `content`: the slots used by lists (regions, players, flags...). Lists get as many pages as they need.

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

Sounds of clicks, errors, successes and page turns are at the top of the file (`sounds`), and can be turned off with `open.sounds: false` in `config.yml`.

## Your own buttons

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

```yaml
menus:
  main:
    custom:
      spawn:
        slot: 44
        material: COMPASS
        name: '<green><bold>Spawn'
        lore: ['<gray>Back to the spawn']
        permission: ''
        actions:
          - '[player] spawn'
          - '[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. Avoid the `content` slots of lists |
| `material`, `model`   | Item and custom model data                                                                                                                               |
| `name`, `lore`        | Texts (MiniMessage or `&` codes). They can use `{player}`, PlaceholderAPI placeholders, and in the menus of one region `{region}` and `{id}`             |
| `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] <menu>`       | Opens a menu of rnPsMenu, like typing `/psmenu <menu>`: `main`, `regions`, `shared`, `homes`, `here`, `shop`, `market` (the player's permissions apply) |
| `[sound] <sound>`     | Plays a sound (`minecraft:...`)                                                                                                                         |
| `[close]`             | Closes the menu                                                                                                                                         |
| `[back]`              | Goes back to the menu before                                                                                                                            |

Placeholders in commands: `{player}`, `{uuid}`, `{world}`, and in the menus of one region (region, flags, members, bans...) also `{region}`, `{id}` and `{region-world}`. PlaceholderAPI placeholders work too, when you write them in `menus.yml` (text chosen by players, like region names, is never read as a placeholder).

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

A custom button with a slot outside the menu is reported in the console and skipped.
