Guide to configure custom menus
You can create custom menus in the Aurora/gui/menus folder. You can create subfolders as well inside this folder. Menu filenames must use lowercase english alphabet, numbers and underscore.
Every filename must be unique since that will be the ID of the menu.
# What commands should open the menu?
# Changing this might require a full server restart depending on server version
# (Optional, can be deleted)
register-commands:
- "mymenu"
# Title of the inventory
title: "&6Example Menu"
# How many rows should the inventory have?
rows: 6
# Should we refresh the menu periodically? (most of the times, you don't need this)
# (Optional, can be deleted)
refresh: false
# How often should the menu be refreshed? (in seconds, minimum 1, has to be an integer)
# Defaults to 1
# (Optional, can be deleted)
refresh-interval: 5
# What are the requirements for opening the menu? can be multiple
# (Optional, can be deleted)
open-requirements:
- requirement: "[permission] example.permission"
# What should happen when this requirement isn't met?
deny-actions:
- "[message] You do not have permission to open this menu."
# What should we run when the menu opens?
# (Optional, can be deleted)
open-actions:
- "[sound] entity.villager.yes"
# What should we run when the menu gets closed?
# (Optional, can be deleted)
close-actions:
- "[sound] entity.villager.no"
# Default item to fill the GUI with
# (Optional, can be deleted)
filler:
material: black_stained_glass_pane
hide-tooltip: true
# These are the items for the gui.
# For more info, see Item config and Requirement pages
items:
test:
# Higher priority means if both items are visible on the same slot, this will win
priority: 1
# When periodic refresh is enabled only those items will be refreshed
# that has refresh: true
refresh: true
material: diamond
name: "&6Test Item"
lore:
- "&7%server_time_hh:mm:ss%"
slot: 13
on-click:
- "[open-gui] aaa"
view-requirements:
- "![permission] example.permission"
test2:
priority: 0
material: emerald
name: "&6Test Item {arg_test}"
lore:
- "&7This is a test item."
slot: 13
on-click:
- "[console] say Hello world {arg_test}!"
- "[permission] example.permission"
click-requirements:
- requirement: "[arg] test == example"
deny-actions:
- "[message] test arg is not example! It is {arg_test}"
You can open a menu/gui either by the defined register-commands or via the /aurora gui open <player> <menu> [...args] command. Commands from register-commands don't need any permission and can only be used by players; use open-requirements to restrict who can open the menu. They also can't pass arguments to the menu.
/aurora gui open <player> <menu> arg1={some value} test={10}
If you are trying to open the menu from another menu, you can use the [open-gui] action.
[open-gui] menu_id arg1={some value} test={10}
As you have seen above, you can pass arguments to menus. You can reference these arguments anywhere by using this syntax: {arg_key}. So for the above example: {arg_test}. You can also use these in requirements to control menu item visibility or click requirements.
The {player} placeholder (the name of the player who opened the menu) is also available everywhere in the menu.
Besides the periodic refresh option, the menu is refreshed automatically shortly after a player clicks an item that has click actions (unless those actions contain [close]), and whenever the player's permissions change in LuckPerms. This way items with view-requirements update without reopening the menu.
For the possible click/open/close actions please see Command dispatcher
Everywhere you see on-click you can also define an on-left-click and on-right-click as well. For shift clicks you can use on-shift-left-click and on-shift-right-click.
on-click always runs, no matter how the item was clicked. On top of that, the actions for the specific click type run. If an item has no shift click actions or requirements configured, a shift click behaves like a normal left/right click, so existing menus keep working as before.
items:
shop-item:
material: diamond
slot: 13
name: "&bDiamond"
lore:
- "&7Left click to buy 1"
- "&7Shift + left click to buy 64"
on-left-click:
- "[take-money] 100"
- "[give-item] minecraft:diamond/1"
left-click-requirements:
- requirement: "[money] 100"
deny-actions:
- "[message] &cYou need $100!"
on-shift-left-click:
- "[take-money] 6400"
- "[give-item] minecraft:diamond/64"
shift-left-click-requirements:
- requirement: "[money] 6400"
deny-actions:
- "[message] &cYou need $6400!"
You can view the available view/open/click requirements here: Custom menus requirements
Everywhere you see click-requirements you can define left-click-requirements, right-click-requirements, shift-left-click-requirements and shift-right-click-requirements as well. click-requirements are checked for every click first, then the requirements of the specific click type. If any of them fails, none of the click actions run.