Skip to Content
⚠ Under Construction
ReferenceC++ APIPlayerItemConsumeEvent

endstone::PlayerItemConsumeEvent

Called when a player is finishing consuming an item (food, potion, milk bucket).

Bases: endstone::Cancellable< PlayerEvent >

Functions:

NameDescription
PlayerItemConsumeEvent
getHandGet the hand used to consume the item.
getItemGets the item that is being consumed.

PlayerItemConsumeEvent

PlayerItemConsumeEvent(Player &player, const ItemStack &item, EquipmentSlot hand)

getHand

EquipmentSlot getHand() const

Get the hand used to consume the item.

Returns:

the hand

getItem

std::unique_ptr<ItemStack> getItem() const

Gets the item that is being consumed.

Note:

Modifying the returned item will have no effect, you must use setItem(ItemStack) instead.

Returns:

an ItemStack for the item being consumed

Last updated on