> 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/edlang/features/menus.md).

# Menus

EdLang has three chest menus, in `plugins/EdLang/menus/`:

| File             | Opened by                                                                           |
| ---------------- | ----------------------------------------------------------------------------------- |
| `languages.yml`  | `/lang`                                                                             |
| `settings.yml`   | `/lang settings`, the Settings button                                               |
| `first-join.yml` | the [first-join picker](/p/edlang/features/language-detection.md#first-join-picker) |

They are vanilla chest menus: no resource pack needed. They are written once and never overwritten, so edit them freely and run `/edlang reload`. Every text in them is an `edlang.gui.*` key of `lang/<code>/edlang.yml`, so the menus show in each player's language: change texts there, layout here. Picking a language redraws the open menu at once in the new language.

`menu.enabled: false` turns the menus off: `/lang` then lists the languages in chat (clickable). `/lang list` always shows that list.

## Menu file

```yaml
type: languages                 # 'languages' fills the language list; leave it out for a plain menu
title: '%lang_edlang.gui.title%'
rows: 5
open-sound: 'block.chest.open 0.5 1.2'
click-sound: 'ui.button.click 0.6 1.2'
main-menu: ''                   # a menu opened when this one is closed
update-interval: 0              # ticks between redraws (0 = only when something changes)
commands:                       # extra commands that open this menu
  languages: { command: 'languages', aliases: [langs], permission: '' }
filler:
  material: BLACK_STAINED_GLASS_PANE
  name: '&r'
  # slots: '0-8,36-44'          # leave out to fill every empty slot
items:
  close:
    slot: 42
    material: BARRIER
    name: '%lang_edlang.gui.close.name%'
    left-click-actions:
      - 'close'
```

## Items

| Key                                                                                                                                             |                                                                                                                                         |
| ----------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `material`                                                                                                                                      | A material, `texture-<base64>` (a head with that texture), `head-<player>`, `itemsadder:ns:id`, `oraxen:id`, `nexo:id`, or a `{token}`. |
| `texture`                                                                                                                                       | For `PLAYER_HEAD`: `self` (the viewer's skin) or a base64 texture.                                                                      |
| `amount`, `name`, `lore`, `glow`                                                                                                                |                                                                                                                                         |
| `custom-model-data`, `item-model`, `tooltip-style`                                                                                              | Resource-pack looks (item-model 1.21.4+, tooltip-style 1.21.2+).                                                                        |
| `hide-tooltip`, `color`                                                                                                                         | `color`: leather / potion colour, `#RRGGBB` or `R,G,B`.                                                                                 |
| `slot` / `slots`                                                                                                                                | `13`, `'10-16,19-25'` or a list.                                                                                                        |
| `requirement`                                                                                                                                   | Only shown while the condition holds, e.g. `'{auto} = true'`.                                                                           |
| `click-sound`                                                                                                                                   | This item's sound instead of the menu's.                                                                                                |
| `left-click-actions`, `right-click-actions`, `shift-left-click-actions`, `shift-right-click-actions`, `drop-click-actions`, `any-click-actions` | Actions per click.                                                                                                                      |

Two items may share a slot with opposite requirements (the settings menu does this for its on / off buttons). Items with the ids `previous-page` / `next-page` only show while there is a page to go to.

## Conditions

`requirement:` and `[if ...]` take `left op right` with `=`, `!=`, `>`, `>=`, `<`, `<=`. Numbers compare as numbers, anything else as text (case-insensitive). Tokens and PlaceholderAPI placeholders are filled in first: `'{chat_available} = true'`, `'%player_level% >= 10'`.

A lore line can be conditional: `'[if {auto} = true] &aAutomatic'`. So can an action: `'[if {auto} = false] language auto'`.

## Actions

| Action                               |                                                                  |
| ------------------------------------ | ---------------------------------------------------------------- |
| `message <text>`                     | Chat message to the player.                                      |
| `broadcast <text>`                   | Chat message to everyone.                                        |
| `actionbar <text>`                   | Action bar message.                                              |
| `title <title>;<subtitle>`           | A title.                                                         |
| `player <command>`                   | The player runs a command.                                       |
| `console <command>`                  | The console runs a command (`{player}`, `{uuid}` are filled in). |
| `sound <sound> [volume] [pitch]`     | Plays a sound.                                                   |
| `close`                              | Closes the menu.                                                 |
| `open <menu>`                        | Opens another menu file (by its name without `.yml`).            |
| `page <+1\|-1\|first\|last\|n>`      | Another page.                                                    |
| `refresh`                            | Draws the menu again.                                            |
| `language <code\|auto>`              | Picks a language for the player (or automatic).                  |
| `chat-translation <on\|off\|toggle>` | The player's chat translation switch.                            |

Actions may also be written bracketed: `[console] say hi`.

## The language list (`type: languages`)

```yaml
languages:
  slots: '10-16,19-25'          # more languages than slots = pages
  order: [en, es, fr, de]       # shown first, in this order; the rest follow
  close-on-select: false
  entry:                        # how each language looks
    material: '{icon}'
    name: '%lang_edlang.gui.language.name%'
    lore: ['%lang_edlang.gui.language.lore%']
  selected:                     # laid over 'entry' for the language in use
    glow: true
  icons:                        # per language, any key
    ru: { material: 'texture-...' }
```

Entry tokens: `{name}` `{code}` `{icon}` (its `language.icon`, else a white banner) `{players}` (online players using it) `{selected}` (true / false) `{status}` (selected / in use automatically / click to select).

## Tokens in every menu

`{player}` `{language}` `{language_code}` `{language_icon}` `{mode}` `{auto}` (true / false) `{detected}` (what automatic detection would pick) `{status}` `{chat_translation}` (on / off text) `{chat_translation_enabled}` `{chat_available}` (chat translation set up on the server) `{page}` `{pages}`.

## PinnaPrison

`menu.provider`:

* `builtin`: EdLang's menus (default for new installs).
* `pinnaprison`: the language menu is a PinnaPrison GUI, written once to `plugins/PinnaPrison/guis/<menu.folder>/<menu.gui>.yml`.
* `auto`: PinnaPrison's when it is installed, else the built-in one (servers upgraded from EdLang 1).

The settings and first-join menus are always EdLang's.
