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 Summary
ConstructorsConstructorDescriptionCreativeInventoryActionEvent
(@NotNull Player player, int slot, @NotNull ItemStack clicked) -
Method Summary
Modifier and TypeMethodDescription@NotNull ItemStack
Gets the item which has been clicked.@NotNull Player
Gets the player who is trying to click on the inventory.int
getSlot()
Gets the clicked slot number.boolean
Gets if theEvent
should be cancelled or not.void
setCancelled
(boolean cancel) Marks theEvent
as cancelled or not.void
setClickedItem
(@NotNull ItemStack clickedItem) Changes the clicked item.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minestom.server.event.trait.EntityInstanceEvent
getInstance
Methods inherited from interface net.minestom.server.event.trait.PlayerEvent
getEntity
-
Constructor Details
-
CreativeInventoryActionEvent
-
-
Method Details
-
getPlayer
Gets the player who is trying to click on the inventory.- Specified by:
getPlayer
in interfacePlayerEvent
- Returns:
- the player who clicked
-
getSlot
public int getSlot()Gets the clicked slot number.- Returns:
- the clicked slot number
-
getClickedItem
Gets the item which has been clicked.- Returns:
- the clicked item
-
setClickedItem
Changes the clicked item.- Parameters:
clickedItem
- the clicked item
-
isCancelled
public boolean isCancelled()Description copied from interface:CancellableEvent
Gets if theEvent
should be cancelled or not.- Specified by:
isCancelled
in interfaceCancellableEvent
- Returns:
- true if the event should be cancelled
-
setCancelled
public void setCancelled(boolean cancel) Description copied from interface:CancellableEvent
Marks theEvent
as cancelled or not.- Specified by:
setCancelled
in interfaceCancellableEvent
- Parameters:
cancel
- true if the event should be cancelled, false otherwise
-