#Can I make custom edible items give you effects?
1 messages · Page 1 of 1 (latest)
Yes
With beforeItemUse
import { world, MinecraftEffectTypes } from "@minecraft/server"
world.events.beforeItemUse.subscribe(e => {
if (e.item.typeId !== "youritemId")
return;
e.source.addEffect(MinecraftEffectTypes.hunger, timeInTicks, duration, showParticles? true or false)
})
You can also do this directly with json
I would recommend doing it in the json file of the item
Where would you put this?