Minecraft – Lowering visible and actual amount of hearts player has

minecraft-java-edition

If you've ever played Rocket Rumble on the Antvenom server, which is a great game, you'd notice that the player has, only three visible hearts, or to be technical, six. Here's a picture:
Now, as you can see, the player has only three visible, or six actual hearts. What I'm interested in doing is lowering the health of a player to five visible hearts. Is this possible? Or is it just plugin trickery?

Best Answer

Use a "corrupt" potion effect. This may not work in later versions/snapshots due to bugs.

/effect @p 21 (a number). The number is at or greater then 127. Each integer greater then 127 deducts 4 hearts (8 health points). If the number is less then 127, it will add hearts, starting at 1 being 4 hearts, then add 4 per level. 126 would add a really big amount of hearts so don't screw up!