So, for my PvP arena I used to have a command:
effect @a minecraft:saturation 1000000 20 true... which runs constantly to keep the hunger bar full, so that natural regeneration slowly regenerates health.
However, if do it in the latest snapshot, this effect breaks with the new food system and instead it regenerates health at a ridiculous rate (1 heart per second), even if saturation is at level 1.
Is there any way I can keep the hunger up, but with a lower regeneration rate than the one that has been introduced in the 1.9 snapshots?
33 Answers
You could try turning off natrual regeneration, and using your own regeneration system of you own.
Of course, it's not perfect - But it somewhat mimics the pre-1.9 behaviors.
Step 1: Turn off Natural Regeneration
/gamerule naturalRegeneration falseStep 2: Create a clock that every four seconds runs the following command:
/effect @a 10 1 true
OR
/effect @a minecraft:regeneration 1 trueThis gives a regeneration effect that's long enough to heal one health (half-a-heart) every four seconds, since heal heals by one when hunger is above 18 (9 steaks) every four seconds.
At Regeneration II, hearts heal at a rate of 0.8 hearts per second, therefore - 1 seconds is enough to give one health (half-a-heart), but not the second health to fill up a whole heart as a whole heart takes 1.25 seconds to generate at this potency.
So you want your players to never starve, but also not to regenerate too quickly? Here's the best solution I could find:
First, we need to make sure the hunger bar stays at 19 so that both your players don't starve AND they regenerate slower. To do this, first, let's create an objective to detect the players' hunger.
- Type: /scoreboard objectives add [YOUR OBJECTIVE NAME] food <--- This will detect the players' hunger levels. (whether they are on 20, 19, etc., but it'll NOT detect a certain hunger level
- Put a command block and put this command into it: /effect give @a[scores={YOUR OBJECTIVE NAME=18}] minecraft:saturation 1 0 true <--- This will make it so that if a player's hunger is 18 and below, it'll put them back to 19.
- Set the "Impulse" to "Repeat" and "Needs Redstone" to "Always Active" and boom! You're done! <--- This applies to the command block you just put on your server.
Remember, this only applies once your players' hunger effect starts to decrease, which won't be a problem since the hunger bar decreases quicker than the Speed II effect.
Now, if you did that all correctly, your players' hunger bars should stay at 19 and neither decrease OR increase. (unless you are planning to give them golden apples, then it'll increase)
And there you go! It's all done. Sorry for the late response by the way.
You could try adding no flinch to the server, and make it take away health while regenerating health. But if you want to keep it vanilla and/or want the PvP to stay mod-free then I don't know if that suggestion will work. But maybe if you can calculate how many hearts it regenerates per second and put a regenerate effect on the command block based on the seconds, then that could work. I don't know, I'm just trying to be creative here so I could help you out.
1