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 ItemStackGets the item which has been clicked.@NotNull PlayerGets the player who is trying to click on the inventory.intgetSlot()Gets the clicked slot number.booleanGets if theEventshould be cancelled or not.voidsetCancelled(boolean cancel) Marks theEventas cancelled or not.voidsetClickedItem(@NotNull ItemStack clickedItem) Changes the clicked item.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minestom.server.event.trait.EntityInstanceEvent
getInstanceMethods 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:
getPlayerin 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:CancellableEventGets if theEventshould be cancelled or not.- Specified by:
isCancelledin interfaceCancellableEvent- Returns:
- true if the event should be cancelled
-
setCancelled
public void setCancelled(boolean cancel) Description copied from interface:CancellableEventMarks theEventas cancelled or not.- Specified by:
setCancelledin interfaceCancellableEvent- Parameters:
cancel- true if the event should be cancelled, false otherwise
-