Main Menu Configuration
The Main Menu is the first menu that pops up when a player types the /settings
command. It acts as a central hub for navigating to other pages in your settings system. You can configure this menu to display items that serve as shortcuts to specific pages, allowing for a smooth user experience.
Structure of the Main Menu
Below is the structure required for the main menu:
Structure of the Main Menu
Below is the structure required for the main menu:
Key Fields in the Main Menu Configuration
1. Inventory
The top-level configuration for the main menu:
size
: The total size of the inventory (must be a multiple of 9). Example:54
name
: The title of the menu displayed at the top. Example:"Settings - Page %page%"
Page-Count
: The total number of pages for this menu. Example:1
2. Filler Slots
filler
: Used to fill empty slots in the inventory with a specific item.Example:
3. Navigation Buttons
Next-Page
andPrevious-Page
: Items used to navigate between pages of the main menu.Example:
4. Items
The items
section defines individual interactive elements within the main menu. Each item represents a shortcut to another settings page.
Item Fields
page
: The page number this item is associated with in the settings system.slot
: The slot number (0-based index) where this item will appear in the inventory.material
: The material type for the item. Example:REDSTONE
displayName
: The name displayed for the item. Example:"&eGeneral Settings"
SettingPageName
: The name of the settings page this item links to. It should correspond to the YAML file inside the Pages folder. Example:"Settings.yml"
permission
(optional): The permission required to view and interact with this item. Example:"menu.settings"
amount
: The number of items in the stack. Example:1
lore
: A list of strings for the item's description. Example:
Example Main Menu Configuration
Here’s a complete example of a main menu with two interactive items:
Connecting the Main Menu to Pages
When a player clicks an item in the main menu:
The plugin will open the settings page defined by the
SettingPageName
field. Example: Clicking the "General Settings" item will open the page configured inSettings.yml
.You can add as many items as necessary to connect to all your pages.
Permissions (e.g.,
"menu.settings"
) can restrict access to specific items, making it useful for role-based access.
Last updated