Skip to main content

Submenus

Secondary screens (shops, warp menus, settings panels) are created inside the plugins/EasyMenu/sub/ directory.


File Organization​

A submenu's file name (excluding the .yml extension) serves as its Menu ID:

plugins/EasyMenu/
├── main.yml # Main menu (ID: main)
└── sub/
├── shop.yml # Submenu (ID: shop)
├── warp.yml # Submenu (ID: warp)
└── admin/
└── panel.yml # Nested submenu (ID: panel)

Menu IDs do not include folder names; duplicate YAML filenames in different folders are rejected as duplicate IDs.

Search Depth

Nested subdirectories are searched up to submenu.search-depth levels (default: 3) configured in config.yml. The allowed range is 1-16. A value outside that range, or one that is not a number, is ignored and the default 3 is used. Menu IDs are case-insensitive (Shop.yml and shop.yml are the same ID).


Cross-Menu Navigation​

You can link menus together in two ways:

Method 1: Shorthand (sub_<ID> / main_mainopen)​

The simplest way using the command property:

plugins/EasyMenu/main.yml
menu-items:
# Opens sub/shop.yml
- slot: 11
material: EMERALD
name: "&aOpen Shop"
command: "sub_shop"
close-menu: true

# Opens sub/warp.yml
- slot: 15
material: COMPASS
name: "&bWarp List"
command: "sub_warp"
close-menu: true

To return to the main menu from any submenu:

plugins/EasyMenu/sub/shop.yml
menu-items:
# Return to main menu
- slot: 22
material: BARRIER
name: "&cBack to Main Menu"
command: "main_mainopen"
close-menu: true

Method 2: Typed Action (type: open-menu)​

Best for multi-action sequences and explicit definitions:

menu-items:
- slot: 13
material: EMERALD
name: "&aGo to Shop"
actions:
- type: sound
sound: "UI_BUTTON_CLICK"
- type: open-menu
menu: "shop"
- type: message
message: "&aOpened the shop menu."
Guaranteed Sequential Order

In EasyMenu 7, open-menu waits for the renderer to finish opening the target menu before proceeding to the next action. This does not confirm successful rendering on the client.


Typos Caught at Reload​

If a menu contains an open-menu action targeting a non-existent menu ID (e.g. open-menu: missing_menu), /menu reload rejects the candidate immediately. This prevents players from encountering broken transitions during gameplay.