endstone::PlayerItemConsumeEvent
Called when a player is finishing consuming an item (food, potion, milk bucket).
Bases: endstone::Cancellable< PlayerEvent >
Functions:
| Name | Description |
|---|---|
PlayerItemConsumeEvent | |
getHand | Get the hand used to consume the item. |
getItem | Gets the item that is being consumed. |
PlayerItemConsumeEvent
PlayerItemConsumeEvent(Player &player, const ItemStack &item,
EquipmentSlot hand) getHand
EquipmentSlot getHand() constGet the hand used to consume the item.
Returns:
the hand
getItem
std::unique_ptr<ItemStack> getItem() constGets 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