Class PlayerDropItemEvent
java.lang.Object
fr.fidorial.event.player.PlayerDropItemEvent
- All Implemented Interfaces:
Cancellable, Event, PlayerEvent
Fired when a player presses the drop key with an item in hand.
- Since:
- 0.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerDropItemEvent(Player player, ItemStack item, boolean wholeStack) Creates an event. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrueif the action this event describes will not happen.item()Returns what the selected hotbar slot holds,ItemStack.EMPTYwhen nothing.player()Returns the player involved in this event.voidsetCancelled(boolean cancelled) Prevents or re-allows the action this event describes.booleanReturns whether the whole stack is dropped rather than one item.
-
Constructor Details
-
PlayerDropItemEvent
Creates an event.- Parameters:
player- the playeritem- what the selected hotbar slot holds,ItemStack.EMPTYwhen nothingwholeStack- whether the whole stack is dropped (Ctrl+Q) rather than one item- Since:
- 0.1.0
-
-
Method Details
-
player
Description copied from interface:PlayerEventReturns the player involved in this event.- Specified by:
playerin interfacePlayerEvent- Returns:
- the player involved in this event
-
item
Returns what the selected hotbar slot holds,ItemStack.EMPTYwhen nothing.- Returns:
- what the selected hotbar slot holds,
ItemStack.EMPTYwhen nothing - Since:
- 0.1.0
-
wholeStack
public boolean wholeStack()Returns whether the whole stack is dropped rather than one item.- Returns:
- whether the whole stack is dropped rather than one item
- Since:
- 0.1.0
-
isCancelled
public boolean isCancelled()Description copied from interface:CancellableReturnstrueif the action this event describes will not happen.- Specified by:
isCancelledin interfaceCancellable- Returns:
trueif the action this event describes will not happen
-
setCancelled
public void setCancelled(boolean cancelled) Description copied from interface:CancellablePrevents or re-allows the action this event describes.- Specified by:
setCancelledin interfaceCancellable- Parameters:
cancelled-trueto prevent it
-