Creating menus
The main menu is stored in main.yml.
Each YAML file in the sub folder defines a submenu.
Menu settings
menu-title: "&6&lServer Menu"
menu-opensound: "UI_BUTTON_CLICK"
menu-background-item: "GRAY_STAINED_GLASS_PANE"
menu-size: 54
menu-items: []
| Setting | Description |
|---|---|
menu-title | Text shown at the top of the menu |
menu-opensound | Sound played when the menu opens |
menu-background-item | Material used to fill empty positions |
menu-size | One of 9, 18, 27, 36, 45, or 54 |
menu-items | Items shown in the menu |
Add an item
menu-items:
- location: "5,3"
material: "EMERALD"
name: "&aShop"
lore:
- "&7Click to open the shop"
command: "sub_shop"
sound: "UI_BUTTON_CLICK"
close-menu: true
custom-model-data: 1001
| Setting | Description |
|---|---|
location | Position as column,row. The top-left position is 1,1 |
slot | Zero-based slot number used instead of location |
material | Minecraft material name |
name | Display name |
lore | Description shown below the name |
command | Legacy click behavior |
action | EasyMenu 6 click behavior |
sound | Sound played after a click |
close-menu | Whether the menu closes after a click |
custom-model-data | CustomModelData used by a resource pack |
If both location and slot are present, EasyMenu uses slot and writes a warning to the console.
Add colors
Titles, item names, lore, and messages support legacy color codes beginning with &.
name: "&aGreen text"
lore:
- "&7Gray description"
- "&eYellow description"
Common colors include &a for green, &b for aqua, &c for red, &e for yellow, &f for white, and &7 for gray.
Create a submenu
Create plugins/EasyMenu/sub/shop.yml.
The menu ID is the filename without .yml, so this menu's ID is shop.
menu-title: "&aShop"
menu-background-item: "LIME_STAINED_GLASS_PANE"
menu-size: 27
menu-items:
- location: "5,2"
material: "BARRIER"
name: "&cBack"
command: "main_mainopen"
close-menu: true
Open it from another menu with this legacy setting.
command: "sub_shop"
Legacy command values
| Value | Behavior |
|---|---|
/spawn | Run /spawn as the player |
sub_shop | Open the menu with ID shop |
main_mainopen | Return to the main menu |
The click actions page explains the EasyMenu 6 format.