#say hi
tag @s[scores={KyuRevive=1},nbt={Inventory:[{id:"minecraft:golden_apple"}]}] add InitiateReviveT1
tag @s[scores={KyuRevive=3},nbt={Inventory:[{id:"minecraft:blaze_powder"}]},nbt=!{Inventory:[{id:"minecraft:blaze_powder",Count:1b}]},nbt={Inventory:[{id:"minecraft:golden_apple"}]},nbt={Inventory:[{id:"minecraft:ghast_tear"}]}] add InitiateReviveT2
tag @s[scores={KyuRevive=5},nbt={Inventory:[{id:"minecraft:blaze_powder"}]},nbt=!{Inventory:[{id:"minecraft:blaze_powder",Count:1b}]},nbt=!{Inventory:[{id:"minecraft:blaze_powder",Count:2b}]},nbt={Inventory:[{id:"minecraft:ghast_tear"}]},nbt=!{Inventory:[{id:"minecraft:ghast_tear",Count:1b}]},nbt={Inventory:[{id:"minecraft:wither_skeleton_skull"}]}] add InitiateReviveT3
clear @s[tag=InitiateReviveT1] golden_apple 1
clear @s[tag=InitiateReviveT2] golden_apple 1
clear @s[tag=InitiateReviveT2] blaze_powder 2
clear @s[tag=InitiateReviveT2] ghast_tear 1
clear @s[tag=InitiateReviveT3] blaze_powder 3
clear @s[tag=InitiateReviveT3] ghast_tear 2
clear @s[tag=InitiateReviveT3] wither_skeleton_skull 1

execute at @s[tag=InitiateReviveT1] run scoreboard players set @p[tag=KyuRevivingT1,scores={KyuRevive=2},distance=..21] KyuDeath 0
execute at @s[tag=InitiateReviveT1] run tag @p[tag=KyuRevivingT1,scores={KyuRevive=2},distance=..21] remove KyuDead
execute at @s[tag=InitiateReviveT1] run tag @p[tag=KyuRevivingT1,scores={KyuRevive=2},distance=..21] remove DeadKyu
execute at @s[tag=InitiateReviveT1] run gamemode survival @p[tag=KyuRevivingT1,scores={KyuRevive=2},distance=..21]
execute at @s[tag=InitiateReviveT1] run execute as @p[tag=KyuRevivingT1,scores={KyuRevive=2},distance=..21] run function zzzzdonotuse:misc/revive/clearwholeinventory
#execute as @s[tag=InitiateReviveT1] run hurt player
execute at @s[tag=InitiateReviveT1] run execute as @p[tag=KyuRevivingT1,scores={KyuRevive=2},distance=..21] run give @s stone_axe
execute at @s[tag=InitiateReviveT1] run execute as @p[tag=KyuRevivingT1,scores={KyuRevive=2},distance=..21] run give @s stone_pickaxe
execute at @s[tag=InitiateReviveT1] run execute as @p[tag=KyuRevivingT1,scores={KyuRevive=2},distance=..21] run give @s golden_shovel
execute at @s[tag=InitiateReviveT1] run execute as @p[tag=KyuRevivingT1,scores={KyuRevive=2},distance=..21] run give @s bread 3
execute at @s[tag=InitiateReviveT1] run execute as @p[tag=KyuRevivingT1,scores={KyuRevive=2},distance=..21] run give @s water_bucket
execute at @s[tag=InitiateReviveT1] run execute as @p[tag=KyuRevivingT1,scores={KyuRevive=2},distance=..21] run give @s shield
execute at @s[tag=InitiateReviveT1] run execute as @p[tag=KyuRevivingT1,scores={KyuRevive=2},distance=..21] run effect clear @s blindness


execute at @s[tag=InitiateReviveT1] run execute as @p[tag=KyuRevivingT1,scores={KyuRevive=2},distance=..21] run tag @s add VoidReviving
execute at @s[tag=InitiateReviveT1] run execute as @p[tag=KyuRevivingT1,scores={KyuRevive=2},distance=..21] run tag @s add DoVoid
execute at @s[tag=InitiateReviveT1] run execute as @p[tag=KyuRevivingT1,scores={KyuRevive=2},distance=..21] run scoreboard players set @s KyuVoid -100
execute at @s[tag=InitiateReviveT1] run execute as @p[tag=KyuRevivingT1,scores={KyuRevive=2},distance=..21] run function zzzzdonotuse:misc/activatevoiddamage

execute at @s[tag=InitiateReviveT2] run scoreboard players set @p[tag=KyuRevivingT2,scores={KyuRevive=4},distance=..21] KyuDeath 0
execute at @s[tag=InitiateReviveT2] run tag @p[tag=KyuRevivingT2,scores={KyuRevive=4},distance=..21] remove KyuDead
execute at @s[tag=InitiateReviveT2] run tag @p[tag=KyuRevivingT2,scores={KyuRevive=4},distance=..21] remove DeadKyu
execute at @s[tag=InitiateReviveT2] run gamemode survival @p[tag=KyuRevivingT2,scores={KyuRevive=4},distance=..21]
#execute as @s[tag=InitiateReviveT2] run clear partial inven
execute at @s[tag=InitiateReviveT2] run execute as @p[tag=KyuRevivingT2,scores={KyuRevive=4},distance=..21] run function zzzzdonotuse:misc/revive/clearpartialinventory
#execute as @s[tag=InitiateReviveT2] run hurt player
execute at @s[tag=InitiateReviveT2] run execute as @p[tag=KyuRevivingT2,scores={KyuRevive=4},distance=..21] run give @s stone_axe
execute at @s[tag=InitiateReviveT2] run execute as @p[tag=KyuRevivingT2,scores={KyuRevive=4},distance=..21] run give @s stone_pickaxe
execute at @s[tag=InitiateReviveT2] run execute as @p[tag=KyuRevivingT2,scores={KyuRevive=4},distance=..21] run give @s golden_shovel
execute at @s[tag=InitiateReviveT2] run execute as @p[tag=KyuRevivingT2,scores={KyuRevive=4},distance=..21] run give @s golden_apple
execute at @s[tag=InitiateReviveT2] run execute as @p[tag=KyuRevivingT2,scores={KyuRevive=4},distance=..21] run give @s bread 3
execute at @s[tag=InitiateReviveT2] run execute as @p[tag=KyuRevivingT2,scores={KyuRevive=4},distance=..21] run give @s water_bucket
execute at @s[tag=InitiateReviveT2] run execute as @p[tag=KyuRevivingT2,scores={KyuRevive=4},distance=..21] run give @s shield
execute at @s[tag=InitiateReviveT1] run execute as @p[tag=KyuRevivingT2,scores={KyuRevive=4},distance=..21] run effect clear @s blindness

execute at @s[tag=InitiateReviveT2] run execute as @p[tag=KyuRevivingT2,scores={KyuRevive=4},distance=..21] run tag @s add VoidReviving
execute at @s[tag=InitiateReviveT2] run execute as @p[tag=KyuRevivingT2,scores={KyuRevive=4},distance=..21] run tag @s add DoVoid
execute at @s[tag=InitiateReviveT2] run execute as @p[tag=KyuRevivingT2,scores={KyuRevive=4},distance=..21] run scoreboard players set @s KyuVoid -100
execute at @s[tag=InitiateReviveT2] run execute as @p[tag=KyuRevivingT2,scores={KyuRevive=4},distance=..21] run function zzzzdonotuse:misc/activatevoiddamage


execute at @s[tag=InitiateReviveT3] run scoreboard players set @p[tag=KyuRevivingT3,scores={KyuRevive=6},distance=..21] KyuDeath 0
execute at @s[tag=InitiateReviveT3] run tag @p[tag=KyuRevivingT3,scores={KyuRevive=6},distance=..21] remove KyuDead
execute at @s[tag=InitiateReviveT3] run tag @p[tag=KyuRevivingT3,scores={KyuRevive=6},distance=..21] remove DeadKyu
execute at @s[tag=InitiateReviveT3] run gamemode survival @p[tag=KyuRevivingT3,scores={KyuRevive=6},distance=..21]
execute at @s[tag=InitiateReviveT1] run execute as @p[tag=KyuRevivingT3,scores={KyuRevive=6},distance=..21] run effect clear @s blindness


function zzzzdonotuse:misc/revive/reset