| Name | player consumes item |
| Event Lines | player consumes item
player consumes <item> |
| Triggers | when a player consumes (eats/drinks) an item (like food or potions). |
| Generated Examples | on player consumes item:
after player consumes item: after player consumes red_banner: |
| Has Player | Always. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link. |
| Contexts | <context.item> returns the ItemTag.
<context.hand> returns an ElementTag of the hand being used to consume the item. Can be either HAND or OFF_HAND. Requires a 1.19+ server.
|
| Determine | ItemTag to change the item being consumed. Use with caution, if the player is eating a stack of items, this will replace the entire stack. |
| Cancellable | True - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false' |
| Has Location | True - This adds the switches 'in:<area>', 'location_flagged:<flag>', ... |
| Group | Player |
| Source | https://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerConsumesScriptEvent.java#L21 |