PT-BR EN ES
Channel Icon

Crazy Ozz

Official Channel Website

Command Block

How to Decrease Max Health and Lose Hearts in Minecraft

Minecraft Java Edition 1.21+ and 26+ (Attribute Command + Max Health)

In this tutorial, you will learn how to decrease max health in Minecraft Java Edition 1.21+ and 26+ by reducing player hearts using the /attribute command and the minecraft:generic.max_health attribute. This method is perfect for hardcore challenges, custom maps, minigames, and survival modes with limited health.

Let's create the scoreboard below, which will score according to the amount of health we have.

scoreboard objectives add set_health health

By default, our health is 20, represented by 10 hearts.

Place a Repeat command block set to Always Active with this command:

execute as @a[scores={set_health=19}] run attribute @s minecraft:generic.max_health base set 19

As soon as a player's health in the world reaches 19, the attribute command is executed and will reduce the maximum health according to the player's current health.

For 18 health, you will need to do the same command, just replacing 19 with 18 in the commands above. For 17 it's the same thing, and so on.

You can place other Chain command blocks set to Always Active connected to the Repeat command block and line them all up. The video below shows the idea well.

If you want to return to the default maximum health, just run this command:

attribute @p minecraft:generic.max_health base set 20

Want cheap and lag-free Minecraft hosting?

I recommend Sparked Host: affordable plans, great performance, easy panel and fast support.

🚀 Start your Minecraft Server

Still have questions? Watch the video below