I want to figure out how to increment a player's health without writing 225 lines of Datapack code. I cannot find any way to do this. I've tried :

execute at @a run execute unless score @p custHealth matches 1 run attribute @p generic.max_health base set Health @p 

but that does not work.

1 Answer 1


Try this command (amplifier is no. of hearts)

/effect give @a health_boost <duration> <amplifier>

Or for permanent use:

/attribute @a minecraft:generic.max_health base set 2

In this case 2 means 1 heart, so you enter e.g. 60 for 30 hearts.

  • so the first command doesnt work, the syntax is wrong. the second command does not answer my question
    – 2wen
    May 31 at 15:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .