Buttons are the interactive elements within a menu that players can click to trigger various actions. Each button can be customized to display specific menus, run commands, send messages, and more.
Buttons component of a menu is a list of buttons, which has the following properties:
Button Display
Slot
Description: Defines the position of the button in the menu. Slot numbers start from 0 and go up to the size of the menu.
Type: Integer or List of Integer or String
Optional:true
Example:
slot:10slots:-1-2-3slots:-"5 to 9"-12slots:"0 to 44"
Amount
Description: Specifies how many of the item should be displayed in the button slot.
Type: Integer
Optional:true
Example:
Material
Description: The Minecraft material for the button. This is the actual item that players will see in the slot.
lore:
- "&7Click to execute a command"
- "<black>Line 2 of lore"
lore:
java:
- "line 1"
- "line 2"
bedrock:
- "Some text"
enchantments:
- SHARPNESS: 5
- UNBREAKING: 5
custom_model_data: 12131
glow: true
hide_enchants: true
hide_enchantments: true
hide_attributes: true
items:
- material: DIAMOND
amount: 1
name: "name of the item if wanted, can be removed"
lore: "lore of the item if wanted, can be removed"
# enchantments can also be added like in the main button
price: 200.99
requirements:
view:
-
click:
-
actions:
- console: "give %player% diamond_sword" # Command ran a the console
- message: "You have received an epic sword!" # message sent to the player
- sound: "ITEM_PICKUP" # Sound played
- player: "say hi" # command ran by player (can also be command:)
- sound: "ENTITY_EXPERIENCE_ORB_PICKUP"
- menu: "anothermenu" # Open another menu
- close # Close the menu