So I want to make my own custom minigame just for me and my friends, and I was wondering if I could set certain players hunger bars, or even teams, to 3 so they can't sprint, I would really love to see a command for this, I already know a lot about commandblocks but this I don't.
Minecraft – How to set a specific team/player hungers bar
minecraft-java-edition
Related Topic
- Minecraft Java Edition Commands – How to Enable Sethome and Home on a Vanilla Minecraft Server
- Minecraft Java Edition – How a Player Can Be on Two Teams Simultaneously
- Minecraft Java Edition Commands – How to Teleport Only People Within a Specific Area in Minecraft
- Minecraft Java Edition – How to Make Team Spawn Points Using Commands
- Minecraft – How to set players to different teams
- Minecraft Java Edition – Is It Possible for a Player to Be on Two Teams at Once in Minecraft?
Best Answer
You cannot directly set someone's hunger. You can however give people hunger or saturation status effects to manipulate their hunger levels.
To give everyone on
blue
team Hunger II for 10 seconds:To give everyone on
red
team Saturation V for 20 seconds:Note that the effect potency (last argument) is one less than what it shows as, and the duration (second to last argument) is in seconds on hunger, but ticks on saturation (blame Mojang).
If you want to make sure someone is at a certain level of hunger, you'll need to periodically:
It's a bit of a workaround to the fact that /entitydata doesn't work on players.