execute as @e[nbt={active_effects:[{id:"minecraft:slowness",amplifier:3b}],OnGround:1b}] at @s if entity @e[tag=gateway,distance=..1.8] if score hardmode hardmode matches 1 run tag @s add gatewayready

execute as @e[tag=gatewayready,predicate=survivalplus:overworld] run tag @s add overtofinale
execute as @e[tag=gatewayready,predicate=survivalplus:final_destination] run tag @s add finaletoover

execute as @e[tag=overtofinale,predicate=survivalplus:overworld] at @s in survivalplus:final_destination run tp @s ~ ~ ~
execute as @e[tag=finaletoover,predicate=survivalplus:final_destination] at @s in minecraft:overworld run tp @s ~ ~ ~