#Prevent eating food with the hunger effect
14 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
item foodEaten event
or item right click event, but instead of cancelling the event,~~ remove and give back the item~~
I realise that I should have specified this but the part I don't understand about this is how to check if the player has the hunger effect.
.hasEffect('asd')
Alright I'll just add this to my code and make sure it works before closing the ticket, thanks for the help!
Something like this should work, right?
ItemEvents.rightClicked('#lttw:food', event => {
if (event.player.hasEffect('minecraft:hunger')) {
event.cancel()
}
})```
no
if you want to use the second method:
https://github.com/constellation-mc/andromeda/discussions/163#discussion-7017069
okay i've got it working now, thanks!