execute unless entity @e[type=marker,distance=..40,tag=KyuPreventPortalSpell] run execute at @s[tag=PortalSpell2,tag=!PortalReset] positioned ~ ~ ~ run summon minecraft:armor_stand ~ ~ ~ {CustomName:"\"NetherPortalSpell\"",NoGravity:1}
execute unless entity @e[type=marker,distance=..40,tag=KyuPreventPortalSpell] run execute at @e[type=armor_stand,name=NetherPortalSpell] run fill ~-2 ~-1 ~-1 ~2 ~4 ~1 air destroy
execute unless entity @e[type=marker,distance=..40,tag=KyuPreventPortalSpell] run execute at @e[type=armor_stand,name=NetherPortalSpell] run fill ~-2 ~-1 ~-1 ~2 ~-1 ~1 glowstone destroy
execute unless entity @e[type=marker,distance=..40,tag=KyuPreventPortalSpell] run execute at @e[type=armor_stand,name=NetherPortalSpell] run fill ~-2 ~-1 ~ ~2 ~3 ~ obsidian destroy
execute unless entity @e[type=marker,distance=..40,tag=KyuPreventPortalSpell] run execute at @e[type=armor_stand,name=NetherPortalSpell] run fill ~-1 ~ ~ ~1 ~2 ~ nether_portal
execute unless entity @e[type=marker,distance=..40,tag=KyuPreventPortalSpell] run execute at @e[type=armor_stand,name=NetherPortalSpell] run fill ~-2 ~4 ~ ~2 ~4 ~ fire destroy
execute unless entity @e[type=marker,distance=..40,tag=KyuPreventPortalSpell] run execute at @e[type=armor_stand,name=NetherPortalSpell] run effect give @a[distance=..5] minecraft:resistance 1 6
execute unless entity @e[type=marker,distance=..40,tag=KyuPreventPortalSpell] run execute at @e[type=armor_stand,name=NetherPortalSpell] run summon minecraft:lightning_bolt ~ ~ ~
execute unless entity @e[type=marker,distance=..40,tag=KyuPreventPortalSpell] run execute at @e[type=armor_stand,name=NetherPortalSpell] run playsound minecraft:entity.skeleton_horse.ambient ambient @a[distance=..25] ~ ~ ~ 4 0.7 1
execute unless entity @e[type=marker,distance=..40,tag=KyuPreventPortalSpell] run execute at @e[type=armor_stand,name=NetherPortalSpell] run summon minecraft:lightning_bolt ~ ~ ~
execute unless entity @e[type=marker,distance=..40,tag=KyuPreventPortalSpell] run tellraw @s[tag=PortalSpell2,tag=PortalReset] ["",{"text":"You have already used this spell today - You may use it again tomorrow.","color":"yellow"}]
execute unless entity @e[type=marker,distance=..40,tag=KyuPreventPortalSpell] run tag @s[tag=PortalSpell2,tag=K,tag=!PortalReset] add PortalReset
execute unless entity @e[type=marker,distance=..40,tag=KyuPreventPortalSpell] run execute at @e[type=armor_stand,name=NetherPortalSpell] run playsound minecraft:entity.skeleton_horse.ambient ambient @a[distance=..25] ~ ~ ~ 5 0.7 1
execute unless entity @e[type=marker,distance=..40,tag=KyuPreventPortalSpell] run kill @e[type=armor_stand,name=NetherPortalSpell]
scoreboard players set @s KyuSpells 0

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