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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the item which has been clicked.Gets 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(ItemStack clickedItem) Changes the clicked item.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface EntityInstanceEvent
getInstanceMethods inherited from interface 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
-
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
-