Class GuiComponentClickEvent

java.lang.Object
org.bukkit.event.Event
io.github.toberocat.guiengine.event.spigot.GuiEngineEvent
io.github.toberocat.guiengine.event.spigot.GuiComponentClickEvent

public class GuiComponentClickEvent extends GuiEngineEvent
Represents a custom GUI component click event triggered when a player clicks on a GUI component. It extends the `GuiEngineEvent` class and provides additional information about the click event and the target component.

This class is licensed under the GNU General Public License. Created: 21.05.2023 Author: Tobias Madlberger (Tobias)

  • Nested Class Summary

    Nested classes/interfaces inherited from class org.bukkit.event.Event

    org.bukkit.event.Event.Result
  • Constructor Summary

    Constructors
    Constructor
    Description
    GuiComponentClickEvent(@NotNull GuiContext context, @NotNull org.bukkit.event.inventory.InventoryClickEvent clickEvent, @Nullable GuiComponent targetComponent)
    Constructs a new `GuiComponentClickEvent` with the associated `GuiContext`, click event, and target component (if any).
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull org.bukkit.event.inventory.InventoryClickEvent
    Gets the `InventoryClickEvent` associated with this GUI component click event.
    @Nullable GuiComponent
    Gets the target `GuiComponent` that was clicked by the player.

    Methods inherited from class io.github.toberocat.guiengine.event.spigot.GuiEngineEvent

    getContext, getHandlerList, getHandlers

    Methods inherited from class org.bukkit.event.Event

    getEventName, isAsynchronous

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GuiComponentClickEvent

      public GuiComponentClickEvent(@NotNull @NotNull GuiContext context, @NotNull @NotNull org.bukkit.event.inventory.InventoryClickEvent clickEvent, @Nullable @Nullable GuiComponent targetComponent)
      Constructs a new `GuiComponentClickEvent` with the associated `GuiContext`, click event, and target component (if any).
      Parameters:
      context - The `GuiContext` associated with the event.
      clickEvent - The `InventoryClickEvent` triggered when a player clicks on the GUI.
      targetComponent - The target `GuiComponent` that was clicked, or null if no component was targeted.
  • Method Details

    • getClickEvent

      @NotNull public @NotNull org.bukkit.event.inventory.InventoryClickEvent getClickEvent()
      Gets the `InventoryClickEvent` associated with this GUI component click event.
      Returns:
      The `InventoryClickEvent` triggered when a player clicks on the GUI.
    • getTargetComponent

      @Nullable public @Nullable GuiComponent getTargetComponent()
      Gets the target `GuiComponent` that was clicked by the player.
      Returns:
      The target `GuiComponent`, or null if no component was targeted.