#How to get and set player hunger

7 messages · Page 1 of 1 (latest)

undone sleet
#

I'm making a mod, and I want to reset player hunger when they join the world. This can be in TypeScript, JavaScript, Molang, a command, or editing a JSON value. I haven't found any docs on this yet 😦

still galleon
#

@undone sleet
make it 0 or full?

If it is to make it full you can do:
/effect @p [scores={joined=0}] saturation 3 255 true

undone sleet
#

Yeah, that seems to be the best we can do. It doesn't look like there is an easy way to just get the player's current hunger value 😦

#

To make hunger 0 you can do /effect @p hunger 4 255 true to give them 4 seconds of extremely intense hunger

#

@still galleon do you know where I can find a list of all the default values for scores? I didn't know joined was an option

still galleon
#

I wrote that assuming you have an On Join system made

#

But it is just a normal objective name