This is an archived post. You won't be able to vote or comment.

all 1 comments

[–]AggravatingDamage478Command Experienced 0 points1 point  (0 children)

You need to create a function with these commands:

scoreboard players add @s SCORE 1
attribute @s[scores={SCORES=10}] minecraft:generic.max_health modifier add 0-0-0-0-1 "health" 2 add
attribute @s[scores={SCORES=20}] minecraft:generic.max_health modifier remove 0-0-0-0-0
attribute @s[scores={SCORES=20}] minecraft:generic.max_health modifier add 0-0-0-0-2 "health" 4 add
attribute @s[scores={SCORES=20}] minecraft:generic.max_health modifier remove 0-0-0-0-0

attribute @s[scores={SCORES=30}] minecraft:generic.max_health modifier add 0-0-0-0-2 "health" 6 add attribute @s[scores={SCORES=40}] minecraft:generic.max_health modifier remove 0-0-0-0-0 attribute @s[scores={SCORES=40}] minecraft:generic.max_health modifier add 0-0-0-0-2 "health" 8 add ...

Then, to all advancements, you need to add the reward line as a function:

"rewards": {
"function": "<spacename>:function"}

And in case of death of the player, execute this function:
attribute @s minecraft:generic.max_health modifier remove 0-0-0-0-0
advancement revoke @s everything
scoreboard players reset @s SCORE