Interface Button
public interface Button
Interface representing a clickable button in a user interface.
Buttons can be placed in inventories and respond to player clicks.
-
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.inventory.ItemStackgetItem()Gets the ItemStack that represents this button's visual appearance.default intgetSlot()Gets the slot position where this button should be placed.voidonClick(org.bukkit.entity.Player player) Called when a player clicks on this button.
-
Method Details
-
getSlot
default int getSlot()Gets the slot position where this button should be placed. Default implementation returns slot 0.- Returns:
- the slot number (0-based index)
-
getItem
org.bukkit.inventory.ItemStack getItem()Gets the ItemStack that represents this button's visual appearance.- Returns:
- the ItemStack to display for this button
-
onClick
void onClick(org.bukkit.entity.Player player) Called when a player clicks on this button.- Parameters:
player- the player who clicked the button
-