I am looking to create an area where, when players enter it, their hunger does not deplete but they are not 'invincible' (super-fast regenerating health). I have tried:


/effect @a 23 1000000 1 1

But this just gives the infinite health regen issue.


/testfor @a {foodLevel:17}

(and all food levels below) and given the appropriate saturation, but that is incredibly resource intensive and still provides some form of invinicibility.

Basically I want the hunger to freeze but for saturation to stay at a consistent level. Is there a way to do this through the use of command blocks or functions (it's also important it can be toggled). Thanks

  • Usually a simple testfor shouldn't create too much lag. But since hunger isn't something fast, you could try only running it every few seconds. Other than that, I don't think there is a solution, you already found the best one. Jul 4, 2018 at 19:45

2 Answers 2

/region flag (region name) invincible allow


/region flag region-name feed-delay 1
/region flag region-name feed-amount 20

This gives them a full bar of food every second, without giving "god mode" to anyone in the region.

  • 3
    Um.. Don't you need WorldGuard/Essentials/WorldEdit for this?
    – aytimothy
    Dec 29, 2019 at 20:32

I can help you a little bit. If you use /gamerule naturalRegeneration false then it stops players from gaining health. I use it sometimes for maps. I have no idea if this will help but I`m not a command block person.

  • Doesn't help unfortunately as this needs to be in a specific section of a vanilla survival world. Thanks anyway!
    – Xav
    Jul 4, 2018 at 21:23

You must log in to answer this question.

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