Class GuiComponentClickEvent
java.lang.Object
org.bukkit.event.Event
io.github.toberocat.guiengine.event.spigot.GuiEngineEvent
io.github.toberocat.guiengine.event.spigot.GuiComponentClickEvent
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
ConstructorsConstructorDescriptionGuiComponentClickEvent
(@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 TypeMethodDescription@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
-
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
Gets the target `GuiComponent` that was clicked by the player.- Returns:
- The target `GuiComponent`, or null if no component was targeted.
-