> 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/edcoinflip/coinflips/menus.md).

# Menus (GUIs)

Three chest menus in `plugins/EdCoinflip/guis/`, written once and never overwritten. They use PinnaPrison's menu format, so a file can be copied between PinnaPrison and EdCoinflip. Edit them and run `/cf reload`.

| File                     |                                                                                                             |
| ------------------------ | ----------------------------------------------------------------------------------------------------------- |
| `coinflip.yml`           | the list: paged source `edcoinflip-games` with `entry` (others' coinflips) and `own-entry` (yours)          |
| `coinflip-confirm.yml`   | opened with the coinflip's tokens; the `edcoinflip-join` item joins it                                      |
| `coinflip-animation.yml` | the flip menu; the `edcoinflip-coin` item shows `{face}` while flipping and its `result-item` once it lands |

## Menu file

```yaml
title: '&8Coinflips &7({games})'
rows: 6
open-sound: 'BLOCK_CHEST_OPEN'      # '' = none
click-sound: ''                     # every clickable item
main-menu: ''                       # menu opened when this one is closed
item-click-cooldown: 0              # seconds before the same button reacts again
update-interval: 0                  # ticks between redraws (0 = only when something changes)
commands:                           # extra commands that open this menu
  main: { command: 'flips', aliases: [], permission: '' }
pagination:
  source: 'edcoinflip-games'
  slots: '10-16,19-25,28-34'
  always-show-arrows: false
  previous-page: { slot: 48, material: ARROW, name: '&bPrevious' }
  next-page: { slot: 50, material: ARROW, name: '&bNext' }
items:
  close:
    slot: 53
    material: BARRIER
    name: '&cClose'
    left-click-actions: ['close']
```

## Items

| Key                                                                                                                       |                                                                                                             |
| ------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| `material`                                                                                                                | a material, `head-<player>`, `texture-<base64>`, `itemsadder:ns:id`, `oraxen:id`, `nexo:id`, or a `{token}` |
| `amount`, `name`, `lore`, `glow`, `custom-model-data`, `item-model`, `tooltip-style`, `hide-tooltip`, `color`             |                                                                                                             |
| `slot`                                                                                                                    | `13`, `'10-16,19-25'` or a list                                                                             |
| `requirement`                                                                                                             | only shown while it holds, e.g. `'%player_level% >= 10'`                                                    |
| `click-sound`                                                                                                             | this item's sound                                                                                           |
| `left-click-actions`, `right-click-actions`, `shift-left-click-actions`, `shift-right-click-actions`, `any-click-actions` | actions per click                                                                                           |
| `custom-item.type`                                                                                                        | `open-gui` (with `gui: <menu>`), `edcoinflip-join`, `edcoinflip-coin`                                       |

Lore lines can be conditional: `'[if {games} > 0] &aSomeone is waiting!'`.

## Actions

`message <text>`, `cmessage <text>` (centred), `broadcast <text>`, `actionbar <text>`, `title <text>`, `titlewithsubtitle <title>|<subtitle>`, `player <command>`, `console <command>`, `sound <sound> [volume] [pitch]`, `sound-all ...`, `close`, `open-gui <menu> [key=value ...]`, `page <+1|-1|first|last|n>`, `refresh`. Bracketed (`[console] say hi`) works too.

## Tokens

Coinflip tokens (entries, confirm and flip menus): `{id}` `{player}` / `{creator}` `{joiner}` `{winner}` `{loser}` `{currency}` `{currency-name}` `{symbol}` `{color}` `{icon}` `{amount}` `{amount-short}` `{amount-full}` `{pot}` `{win}` `{tax}` `{tax-percent}` `{age}`, and `{face}` on the coin. Every menu: `{player}` `{games}` `{page-number}` `{total-pages}`. PlaceholderAPI placeholders work everywhere.
