Menu files

Menus are YAML files located in the folder /plugins/ChestCommands/menu/.

The file name is used for checking permissions: use lowercase file names without spaces.

A simple way to create a new menu is to copy an existing one, rename the file and edit its content. A text editor that highlights syntax is recommended (like Sublime Text or Notepad++).

Each menu configuration consists of two sections, settings and icons.

Menu settings

Settings are located at the start of the menu inside the configuration section menu-settings.
Example with all the existing options:

menu-settings:
    name: '&1Example menu'
    rows: 3

    commands:
      - menu
    auto-refresh: 5.0
    open-actions:
      - 'tell: &eYou opened the example menu.'

    open-with-item:
        material: compass
        left-click: false
        right-click: true

Options explanation

You can remove any option not marked as "Required" to disable it.

Option Value type Description
name (Required) string Name that will show up when opening the menu, as a custom inventory title. Cannot be longer than 32 characters (including colors).
rows (Required) integer Number of rows in the menu. Value must be between 1 and 6 (a double chest). If higher, clients will not render the menu correctly.
commands list Players can open the menu by executing on of these commands.
auto-refresh decimal

How frequently placeholders in the menu must be refreshed, in seconds.

Note: the {money} placeholder is automatically updated after every transaction related to Chest Commands, regardless of auto refresh.

open-actions list Actions executed after the menu is opened. Supports all the click actions normally used in icons.
open-with-item
  • material
  • left-click
  • right-click
 
  • string
  • boolean
  • boolean

Allows a specific item to open the menu when left or right clicked in the hand. A specific data value can be required by separating its value with a colon (for example wool:1).

You can also specify which mouse buttons opens the menu when holding the item (at least one of the two must be enabled).

Menu icons

Icons are listed after the menu settings, each one is a top-level configuration section.
Example of a single icon:

spawn-teleport:
    MATERIAL: bed
    POSITION-X: 1
    POSITION-Y: 1
    NAME: '&aReturn to spawn'
    ACTIONS:
      - 'spawn'

The top-level configuration key is the internal name (spawn-teleport in the example) used for identifying the icon.

The internal name must be unique in the YAML file, otherwise icons with the same name are not loaded.
Don't use symbols in the internal name as it needs to be a valid YAML configuration key.

Icons have a list of attributes, to change the appearance and the behaviour.