public static interface ChangeInventoryEvent.Pickup.Pre extends TargetInventoryEvent, TargetItemEvent, Cancellable
Item
is picked up.
Modifying the picked up items causes this event to be automatically canceled if the inventory does not fit the entire list.
Modifier and Type | Method and Description |
---|---|
Optional<List<ItemStackSnapshot>> |
getCustom()
Returns the custom set list of items to add to the inventory or
Optional.empty() if not set. |
List<ItemStackSnapshot> |
getFinal()
Returns the proposed final list of items to add to the inventory.
|
default ItemStackSnapshot |
getOriginalStack()
Returns the original picked up
ItemStackSnapshot
to add to the inventory. |
void |
setCustom(List<ItemStackSnapshot> items)
Sets the items to add to the inventory.
|
getTargetInventory
getTargetEntity
getCause, getContext, getSource
isCancelled, setCancelled
default ItemStackSnapshot getOriginalStack()
ItemStackSnapshot
to add to the inventory.Optional<List<ItemStackSnapshot>> getCustom()
Optional.empty()
if not set.void setCustom(List<ItemStackSnapshot> items)
If all items do not fit the inventory this event will be automatically canceled.
items
- The items to add to the inventoryList<ItemStackSnapshot> getFinal()
If a custom list was set all items have to fit the inventory or this event will be automatically canceled.