execute store result bossbar gravedigger max run attribute @e[tag=gravedigger,limit=1] max_health get
execute store result bossbar gravedigger value run data get entity @e[tag=gravedigger,limit=1] Health
execute if entity @e[tag=gravedigger] run bossbar set gravedigger visible true
execute at @e[tag=gravedigger] run bossbar set gravedigger players @a[distance=..50]
execute as @e[tag=gravedigger] if score @s time < @e[tag=gravedigger,limit=1,sort=arbitrary] time run function survivalplus:bossbar/multibossfix/gravedigger

#execute if score hardmode hardmode matches 1 at @e[tag=gravedigger] run effect give @e[distance=..10,type=zombie,tag=!boss,tag=!player] resistance 1 0
#execute if score hardmode hardmode matches 1 at @e[tag=gravedigger] run particle falling_spore_blossom ~ ~ ~ 8 8 8 .005 5 normal
execute as @e[tag=gravedigger,nbt={HurtTime:10s},tag=armored] run scoreboard players set @s manalvl 4
execute as @e[tag=gravedigger,scores={manalvl=1..}] run function survivalplus:tools/add1hp
execute as @e[tag=gravedigger,scores={manalvl=1..}] run scoreboard players remove @s manalvl 1