#Food item refunding

6 messages · Page 1 of 1 (latest)

gritty forge
#

Hi, this is a pretty simple question i think but i was wondering if theres any methods to make it so food items like the example potion down below give you back a glass bottle upon consumption. I've been looking around for it for a bit now but i cant seem to find anything

StartupEvents.registry('item', event => { event.create("greater_luck_potion") .displayName('Greater Luck Potion') .maxStackSize(16) .rarity('uncommon') .glow(true) .useAnimation('drink') .food(food=>{ food .hunger(0) .saturation(0) .alwaysEdible() .effect('minecraft:luck', 180, 3, 1) }) })

shadow prismBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

gritty forge
#

NVM solved

graceful elmBOT
#

Please post how you solved your issue. Others may find this ticket later, but then have to create another because the actual solution wasn't mentioned. thanks <3

gritty forge
#

StartupEvents.registry('item', event => { event.create("test_potion") .displayName('Potion of Testing') .maxStackSize(16) .useAnimation('drink') .food(food=>{ food .hunger(0) .saturation(0) .alwaysEdible() .effect('minecraft:resistance', 1200, 3, 1) .eaten(ctx => {ctx.player.give('minecraft:glass_bottle') // This is the part that refunds the glass bottle, you can ignore everything else }) }); })