public class PlayerPickupItemEvent extends PlayerEvent implements Cancellable
PlayerInventoryAddEvent will also be called,
unless you cancel this event.PlayerInventoryAddEvent| Constructor and Description |
|---|
PlayerPickupItemEvent(Player player,
WorldItem item,
int targetInventorySlot,
Inventory.SlotType targetInventorySlotType) |
| Modifier and Type | Method and Description |
|---|---|
WorldItem |
getItem()
Gets the item the player wants to pick up.
|
int |
getTargetInventorySlot()
Gets the destinated slot in the players inventory where the item will be
added.
|
Inventory.SlotType |
getTargetInventorySlotType()
Gets the destinated inventory / slot type in the players inventory where
the item will be added.
|
boolean |
isCancelled()
Determines if the event is cancelled.
|
void |
setCancelled(boolean cancel)
Cancels this event.
|
getPlayerpublic PlayerPickupItemEvent(Player player, WorldItem item, int targetInventorySlot, Inventory.SlotType targetInventorySlotType)
public WorldItem getItem()
public int getTargetInventorySlot()
public Inventory.SlotType getTargetInventorySlotType()
public boolean isCancelled()
CancellableisCancelled in interface Cancellablepublic void setCancelled(boolean cancel)
CancellablesetCancelled in interface Cancellablecancel - set to true if you want to cancel this event.