Is there anyway that I can use commands to increase, decrease a players hunger when they have a certain amount of hunger bar, and testfor player's hunger bar in vanilla Minecraft?

  • Have you made any attempt to solve this yourself? Arqade works better when askers show effort to solve their own problems; we see that you have a problem you've worked on, and answerers respond to that. You also get a more specific answer that's tailored exactly to the part you're stuck, and Arqade gets a very specific question. Everybody wins!
    – Frank
    May 20 '16 at 3:49
  • @TheVoidChaos Who? Me? May 20 '16 at 4:25
  • No, someone else did for some odd reason. May 20 '16 at 4:26
  • 1
    Ohh, I see, I voted up May 20 '16 at 4:26

You can use the command:

/testfor @a {foodLevel:20}

20 is full hunger points and 0 is no hunger points... as for setting a hunger amount without the ability to change NBT with players yet there isn't an easy way to do this, you would need to give them the effect of hunger for a set amount of time to get them to the correct level and then to increase it give them a saturation effect for the exact amount of time to get them to the correct level....lots of work and a lot of command blocks.



  • Cool! Don't forget to click on the link for some different methods and discussions! May 20 '16 at 13:55
  • The /testfor command is only available for Bedrock edition
    – ananaso
    Jul 12 '20 at 0:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.