execute unless entity @e[type=marker,distance=..40,tag=KyuPreventEscapeSpell] run execute at @s[tag=EscapeSpell2,tag=!LadderReset,tag=!LadderUpgrade2] positioned ~ ~-2 ~ run summon minecraft:armor_stand ^ ^ ^1 {CustomName:"\"EscapeLadder\"",NoGravity:1,Invisible:1b,Silent:1b}
tellraw @s[tag=EscapeSpell2,tag=!LadderReset] ["",{"text":"Escape Ladder has been activated!","color":"green"}]
execute unless entity @e[type=marker,distance=..40,tag=KyuPreventEscapeSpell] run execute at @s[tag=EscapeSpell2,tag=!LadderReset,tag=LadderUpgrade2] positioned ~ ~-2 ~ run summon minecraft:armor_stand ^ ^ ^1 {Tags:["Upgraded"],CustomName:"\"EscapeLadder\"",NoGravity:1,Invisible:1b,Silent:1b}
#execute unless entity @e[type=marker,distance=..40,tag=KyuPreventEscapeSpell] run 
execute unless entity @e[type=marker,distance=..40,tag=KyuPreventEscapeSpell] run tellraw @s[tag=EscapeSpell2,tag=LadderReset] ["",{"text":"You have already used the Escape Ladder spell today - You may use it again tomorrow.","color":"yellow"}]
execute unless score #KyuQStructuresInstall KyuDummy5 matches 1 run execute unless entity @e[type=marker,distance=..40,tag=KyuPreventEscapeSpell] run execute as @s[tag=EscapeSpell2,tag=!LadderReset] run execute in minecraft:overworld run data merge block 999988 126 999976 {auto:1b}
execute if score #KyuQStructuresInstall KyuDummy5 matches 1 run execute unless entity @e[type=marker,distance=..40,tag=KyuPreventEscapeSpell] run execute as @s[tag=EscapeSpell2,tag=!LadderReset] run execute in minecraft:overworld run data merge block 999989 120 999979 {auto:1b}
execute unless entity @e[type=marker,distance=..40,tag=KyuPreventEscapeSpell] run tag @s[tag=EscapeSpell2,tag=!LadderReset] add LadderReset
#scoreboard players set @s KyuSpells 0

tag @s remove KyuLatentEscapeSpell


execute if entity @e[type=marker,distance=..40,tag=KyuPreventEscapeSpell] run tellraw @s ["",{"text":"A mysterious force prevents you from using this spell here.","color":"gold"}]
