execute store result score @s maxhp run attribute @s max_health get
#100
execute if score @s Health = @s maxhp run function survivalplus:tools/armor/hpcheck/100

#50
scoreboard players set hpcheck itemcount 2
scoreboard players operation @s maxhp /= hpcheck itemcount

execute if score @s Health <= @s maxhp run function survivalplus:tools/armor/hpcheck/50

#20
execute store result score @s maxhp run attribute @s max_health get
scoreboard players set hpcheck itemcount 5
scoreboard players operation @s maxhp /= hpcheck itemcount
execute if score @s Health <= @s maxhp run function survivalplus:tools/armor/hpcheck/20


scoreboard players reset @s maxhp
scoreboard players reset hpcheck itemcount
advancement revoke @s only survivalplus:tools/tick/hpcheck