GUI Configuration Files
Each GUI, whether default or custom, is defined in a YAML file with two main sections: data
and items
. Below is an overview of these sections and their properties.
data Section
The data
section defines the overall properties of the GUI, such as its title, size, and theme.
Key Fields:
menu_title
: The title displayed at the top of the GUI, supporting placeholders (e.g.,&7%gpextension_title% (&2/ClaimIcon&7)
).args
: A list of arguments required by the GUI (e.g.,id
,itemname
for claim ID or item selection).rows
: The number of rows in the GUI (e.g.,6
for a 54-slot inventory).theme
: Specifies the theme to apply (e.g.,default
,clean_4
). The plugin loads<theme_name>_EN.yml
from the theme folder (e.g.,clean_4_EN.yml
).version
: A developer-only field specifying the configuration version (e.g.,1.0
). Do not edit, as it may break the plugin.gui_type
: A developer-only field indicating the type of GUI (e.g.,ICON_SELECTOR
). For custom GUIs, it must match the name ingui.custom_guis
. Do not edit for default GUIs.
Example (from
ClaimUpgradeNoEnter_EN.yml
):Notes:
Admins should only modify
menu_title
,args
,rows
, andtheme
as needed.For custom GUIs, ensure
gui_type
matches thecustom_guis
entry inconfig.yml
.Editing
version
orgui_type
for default GUIs can cause compatibility issues.
items Section
The items
section defines the interactive elements (buttons, icons, etc.) displayed in the GUI, structured similarly to FlagOptions.yml
. Each item is configured under a unique section name (e.g., teleport
, plains
) and supports properties to control its appearance and behavior. Multi-page GUIs include Previous
and Next
sections for navigation.
Key Fields:
material
: The Minecraft item representing the element (e.g.,ENDER_PEARL
,GRASS_BLOCK
).display_name
: The name shown in the GUI, supporting color codes and placeholders (e.g.,&7Plains
).lore
: A list of text lines displayed when hovering, often including descriptions and placeholders (e.g.,&8• &7Current: &f%gpextension_getbyid_flags_parma_ChangeBiome_{claimid}%
).slot
: The specific slot where the item appears, as a single integer (e.g.,10
,31
).slots
: A list of slots where the item appears (e.g.,[10, 11, 12]
), used instead ofslot
.amount
: The stack size of the item (defaults to1
if not specified or invalid).glow
: Iftrue
, the item appears enchanted (e.g.,true
foradd
).model_data
: Custom model data for resource pack textures (optional, e.g.,0
).left_click_commands
: Commands executed on left-click (e.g.,[player] claim tp {claimid}
).right_click_commands
: Commands executed on right-click (e.g.,[player] gpguiflags set {claimid} ChangeBiome PLAINS
).click_commands
: Commands executed for both left and right clicks (used instead of separate left/right commands).priority
: Determines the rendering order of items (e.g.,1
fordisabled
). Items with lower priority override theme items (priority5
).view_requirement
: Conditions for item visibility (e.g., checking if a feature is enabled or if the player has permissions).
Navigation Controls:
Multi-page GUIs include
Previous
andNext
sections to navigate between pages, typically placed in slots47
and51
, respectively.Example configuration:
Special Sections for Custom GUIs:
Some custom GUIs (e.g.,
ICON_SELECTOR
,NO_MOB_SPAWNS_TYPE
) require a specific section initems
matching theirgui_type
(e.g.,ICON_SELECTOR
for dynamic icon population).User-defined custom GUIs (e.g.,
ClaimUpgradeBiomeSelector
) typically use predefined items and may not require a dynamic section.
Example Configurations:
IconSelector.yml (Default Custom GUI with dynamic content and navigation):
ClaimUpgradeBiomeSelector_EN.yml (User-Defined Custom GUI with predefined items):
Notes:
The
ICON_SELECTOR
section inIconSelector.yml
is required for dynamic icon population.ClaimUpgradeBiomeSelector_EN.yml
uses predefined items for biomes and does not require a dynamic section.Navigation controls (
Previous
andNext
) are defined as specific sections in multi-page GUIs, typically in slots47
and51
.Commands use placeholders (e.g.,
{claimid}
,<anvilreply>
) and special actions (e.g.,[close]
,[sound]
).Theme items (priority
5
) are overridden by GUI items with lower priority (e.g.,1
,2
).
Last updated