Class CreativeInventoryActionEvent

java.lang.Object
net.minestom.server.event.inventory.CreativeInventoryActionEvent
All Implemented Interfaces:
Event, CancellableEvent, EntityEvent, EntityInstanceEvent, InstanceEvent, PlayerEvent, PlayerInstanceEvent

public class CreativeInventoryActionEvent extends Object implements PlayerInstanceEvent, CancellableEvent
Called when a player interacts with an item in the creative menu
  • Constructor Details

    • CreativeInventoryActionEvent

      public CreativeInventoryActionEvent(@NotNull @NotNull Player player, int slot, @NotNull @NotNull ItemStack clicked)
  • Method Details

    • getPlayer

      @NotNull public @NotNull Player getPlayer()
      Gets the player who is trying to click on the inventory.
      Specified by:
      getPlayer in interface PlayerEvent
      Returns:
      the player who clicked
    • getSlot

      public int getSlot()
      Gets the clicked slot number.
      Returns:
      the clicked slot number
    • getClickedItem

      @NotNull public @NotNull ItemStack getClickedItem()
      Gets the item which has been clicked.
      Returns:
      the clicked item
    • setClickedItem

      public void setClickedItem(@NotNull @NotNull ItemStack clickedItem)
      Changes the clicked item.
      Parameters:
      clickedItem - the clicked item
    • isCancelled

      public boolean isCancelled()
      Description copied from interface: CancellableEvent
      Gets if the Event should be cancelled or not.
      Specified by:
      isCancelled in interface CancellableEvent
      Returns:
      true if the event should be cancelled
    • setCancelled

      public void setCancelled(boolean cancel)
      Description copied from interface: CancellableEvent
      Marks the Event as cancelled or not.
      Specified by:
      setCancelled in interface CancellableEvent
      Parameters:
      cancel - true if the event should be cancelled, false otherwise