> 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/rncasino/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/rncasino/configuration/languages.md) under `menus.<menu>`.

| Menu                             | Opened with                                                           |
| -------------------------------- | --------------------------------------------------------------------- |
| `bet`                            | `/casino` near a table, the MENU button on the table                  |
| `more`                           | The book in the bet menu                                              |
| `stats`, `top`, `history`        | The More menu, `/casino stats`, `/casino top`, `/casino menu history` |
| `confirm`                        | Questions such as "Stop playing for 7 days?"                          |
| `tables`, `table-edit`, `editor` | `/casino list`, `/casino edit <table>`, `/casino editor` (admins)     |

```yaml
menus:
  more:
    rows: 3
    filler: GRAY_STAINED_GLASS_PANE   # "" = empty slots stay empty
    content: ""
    items:
      stats: {slot: 10, material: WRITABLE_BOOK}
      top: {slot: 12, material: GOLD_INGOT, model: 0}
      exclude: {slot: 16, material: BARRIER, enabled: false}
```

* `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.
* `enabled: false` removes a button.
* `content`: the slots used by lists (results, top players, options...). In the `bet` menu, `content` holds the numbers 1 to 36 in order.

In the `bet` menu, `red-number` and `black-number` set the items of the numbers, and `zero` / `double-zero` the 0 and 00 (00 only shows on American tables). In the `history` menu, `red-result`, `black-result` and `green-result` set the items of the results.

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`).

## Your own buttons

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

```yaml
menus:
  more:
    custom:
      warp:
        slot: 22
        material: COMPASS
        name: "<green><bold>Casino warp"
        lore: ["<gray>Back to the casino"]
        permission: ""
        actions:
          - "[player] warp casino"
          - "[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] <menu>`       | Opens a menu of rnCasino: `bet`, `more`, `stats`, `top`, `history` |
| `[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.
