# Teleports players back to spawn if they open the door
execute positioned 925 68 -998 if block ~ ~ ~ crimson_door[open=true] run function ss:main/spawn

# Safe Zone vs Non Safe Zone
execute positioned 920.5 70.0 -997.5 as @a[scores={location=1..2},distance=..14.5,team=!safe,gamemode=!spectator] at @s unless score @s tempDeaths matches 1.. run function ss:main/team/safe
execute positioned 920.5 70.0 -997.5 as @a[scores={location=1..2},distance=14.5..,team=!pvp,gamemode=!spectator] at @s unless score @s tempDeaths matches 1.. run function ss:main/team/pvp
execute positioned 920.5 70.0 -997.5 run kill @e[type=arrow,distance=..15.5]
execute positioned 920.5 70.0 -997.5 as @e[type=item_display,tag=projectile,distance=..15.5] run function ss:main/projectile/remove

# Safe zone dust particles
particle minecraft:dust{color:[0.000,1.000,0.000],scale:1.5} 934.0 70.0 -997.5 0 1.5 1.5 1 1
particle minecraft:dust{color:[0.000,1.000,0.000],scale:1.5} 933.0 70.0 -1001.5 0 2.0 1.5 1 1
particle minecraft:dust{color:[0.000,1.000,0.000],scale:1.5} 933.0 70.0 -993.5 0 1.5 1.5 1 1

# Lava
execute as @a[scores={location=1..2},gamemode=adventure,tag=!invincible] at @s if block ~ ~ ~ lava run function ss:main/lava_kill

# Water
execute as @a[scores={location=1..2},gamemode=adventure] at @s if block ~ ~ ~ water run function ss:main/map/7/geyser