Class GuiComponentDragEvent

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

public class GuiComponentDragEvent extends GuiEngineEvent
Represents a custom GUI component drag event triggered when a player drags items in the GUI. It extends the `GuiEngineEvent` class and provides additional information about the drag 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
    GuiComponentDragEvent(@NotNull GuiContext context, @NotNull org.bukkit.event.inventory.InventoryDragEvent dragEvent, @Nullable GuiComponent targetComponent)
    Constructs a new `GuiComponentDragEvent` with the associated `GuiContext`, drag event, and target component (if any).
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull org.bukkit.event.inventory.InventoryDragEvent
    Gets the `InventoryDragEvent` associated with this GUI component drag event.
    @Nullable GuiComponent
    Gets the target `GuiComponent` where the dragging started.

    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

    • GuiComponentDragEvent

      public GuiComponentDragEvent(@NotNull @NotNull GuiContext context, @NotNull @NotNull org.bukkit.event.inventory.InventoryDragEvent dragEvent, @Nullable @Nullable GuiComponent targetComponent)
      Constructs a new `GuiComponentDragEvent` with the associated `GuiContext`, drag event, and target component (if any).
      Parameters:
      context - The `GuiContext` associated with the event.
      dragEvent - The `InventoryDragEvent` triggered when a player drags items in the GUI.
      targetComponent - The target `GuiComponent` where the dragging started, or null if no component was targeted.
  • Method Details

    • getDragEvent

      @NotNull public @NotNull org.bukkit.event.inventory.InventoryDragEvent getDragEvent()
      Gets the `InventoryDragEvent` associated with this GUI component drag event.
      Returns:
      The `InventoryDragEvent` triggered when a player drags items in the GUI.
    • getTargetComponent

      @Nullable public @Nullable GuiComponent getTargetComponent()
      Gets the target `GuiComponent` where the dragging started.
      Returns:
      The target `GuiComponent`, or null if no component was targeted.