4

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?

4
  • 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
    Commented May 20, 2016 at 3:49
  • @TheVoidChaos Who? Me? Commented May 20, 2016 at 4:25
  • No, someone else did for some odd reason. Commented May 20, 2016 at 4:26
  • 1
    Ohh, I see, I voted up Commented May 20, 2016 at 4:26

1 Answer 1

1

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.

Credit:

http://www.minecraftforum.net/forums/minecraft-discussion/redstone-discussion-and/2182343-how-to-control-a-players-hunger

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .