scoreboard players enable @a darkspawn

execute as @a[scores={darkspawn=1..}] at @s if entity @s[nbt={active_effects:[{id:"minecraft:slow_falling"}]}] run tellraw @s {"text": "DarkSpawn cannot be triggered while slow falling is active...", "color": "red", "bold":false}

execute as @a[scores={darkspawn=1..}] at @s unless entity @s[nbt={active_effects:[{id:"minecraft:slow_falling"}]}] run execute in minecraft:overworld run tp @s 490 95 -2415

execute as @a[scores={darkspawn=1..}] at @s unless entity @s[nbt={active_effects:[{id:"minecraft:slow_falling"}]}] run tellraw @s {"text": "A dark mage has teleported you to spawn...", "color": "green", "bold":true}

execute as @a[scores={darkspawn=1..}] at @s unless entity @s[nbt={active_effects:[{id:"minecraft:slow_falling"}]}] run effect give @s minecraft:resistance

execute as @a[scores={darkspawn=1..}] at @s unless entity @s[nbt={active_effects:[{id:"minecraft:slow_falling"}]}] run effect give @s minecraft:slow_falling

execute as @a[scores={darkspawn=1..}] run scoreboard players set @s darkspawn 0
