There is currently no way to check if a player has a certain amount of health or hunger before using a command. It would be very helpful for making custom worlds, especially realms, if we could. I believe that using "HP" for health and "H" for hunger would be a good way to implement this.
For example, let's assume I want to give a player speed 1 when they have 5 or less health:
/effect @a[HP=..5] speed 1 0 true
As another example, you could give a screen shake effect to players with 10 or less hunger:
/camerashake @a[H=..10] 1
Please sign in to leave a comment.
0 Comments