public class PlayerInventoryAddEvent extends PlayerEvent implements Cancellable
| Modifier and Type | Class and Description |
|---|---|
static class |
PlayerInventoryAddEvent.Origin |
| Constructor and Description |
|---|
PlayerInventoryAddEvent(Player player,
Item item,
int inventorySlot,
Inventory.SlotType inventorySlotType,
PlayerInventoryAddEvent.Origin origin) |
| Modifier and Type | Method and Description |
|---|---|
int |
getInventorySlot()
Gets the inventory slot.
|
Inventory.SlotType |
getInventorySlotType()
Gets the inventory slot type (e.g. quickslot, equipment etc).
|
Item |
getItem()
Gets the item.
|
PlayerInventoryAddEvent.Origin |
getOrigin()
Gets the origin of the item, i.e. where the player got this item from (i.e.
|
boolean |
isCancelled()
Determines if the event is cancelled.
|
void |
setCancelled(boolean cancel)
Cancels this event.
|
getPlayerpublic PlayerInventoryAddEvent(Player player, Item item, int inventorySlot, Inventory.SlotType inventorySlotType, PlayerInventoryAddEvent.Origin origin)
public Item getItem()
public int getInventorySlot()
public Inventory.SlotType getInventorySlotType()
public PlayerInventoryAddEvent.Origin getOrigin()
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.