Class GuiButton

java.lang.Object
com.github.darksoulq.abyssallib.world.gui.element.GuiItem
com.github.darksoulq.abyssallib.world.gui.element.GuiButton
All Implemented Interfaces:
GuiElement

public class GuiButton extends GuiItem
An interactive GUI element that executes an action when clicked.

This element displays an item but executes a provided consumer logic when a player interacts with it. It is the primary way to create clickable controls in a GUI. (Item may be null)

  • Constructor Details

    • GuiButton

      public GuiButton(org.bukkit.inventory.ItemStack item, Consumer<GuiClickContext> action)
      Constructs a new GuiButton.
      Parameters:
      item - the button icon
      action - the logic to run on click
  • Method Details