public interface ChangeEntityEquipmentEvent extends TargetEntityEvent, TargetInventoryEvent, Cancellable
Slot
belonging to an Inventory
of an Entity
is filled with an ItemStack
, emptied of an ItemStack
,
or swapped with an ItemStack
. The requirement of course is
that if the getOriginalItemStack()
is Optional.absent()
, then
the getItemStack()
must be present, and vice versa. In the event
that a change to the suggested ItemStack
, the use of the
ItemStackTransaction
is recommended.Modifier and Type | Interface and Description |
---|---|
static interface |
ChangeEntityEquipmentEvent.TargetHuman
An event where a
Human entity is targeted. |
static interface |
ChangeEntityEquipmentEvent.TargetLiving
An event where a
Living entity is targeted. |
static interface |
ChangeEntityEquipmentEvent.TargetPlayer
An event where a
Player entity is targeted. |
Modifier and Type | Method and Description |
---|---|
Optional<ItemStackTransaction> |
getItemStack()
Gets the new
ItemStack that is being equipped in the relative
armor slot. |
Optional<ItemStackSnapshot> |
getOriginalItemStack()
Gets the previously equipped
ItemStack as an
ItemStackSnapshot . |
Slot |
getTargetInventory() |
getTargetEntity
getCallbacks
isCancelled, setCancelled
Optional<ItemStackSnapshot> getOriginalItemStack()
ItemStack
as an
ItemStackSnapshot
.
The previously equipped item may have been empty.
Optional<ItemStackTransaction> getItemStack()
ItemStack
that is being equipped in the relative
armor slot.
The itemstack may not exist or the slot is being emptied.
Slot getTargetInventory()
getTargetInventory
in interface TargetInventoryEvent
Inventory