scoreboard players set %OLD svm_ep.previous_dimension 0

execute if dimension minecraft:the_nether run scoreboard players set %OLD svm_ep.previous_dimension 1
execute if dimension minecraft:the_end run scoreboard players set %OLD svm_ep.previous_dimension 2
execute if dimension svm_ep:paradise run scoreboard players set %OLD svm_ep.previous_dimension 3
execute if dimension svm_ep:cherry_island run scoreboard players set %OLD svm_ep.previous_dimension 4
execute if dimension svm_ep:pocket run scoreboard players set %OLD svm_ep.previous_dimension 5
execute if dimension svm_ep:void run scoreboard players set %OLD svm_ep.previous_dimension 6

execute as @s[scores={svm_ep.previous_dimension=0}] in minecraft:overworld run tp @s ~ ~ ~
execute as @s[scores={svm_ep.previous_dimension=1}] in minecraft:the_nether run tp @s ~ ~ ~
execute as @s[scores={svm_ep.previous_dimension=2}] in minecraft:the_end run tp @s ~ ~ ~
execute as @s[scores={svm_ep.previous_dimension=3}] in svm_ep:paradise run tp @s ~ ~ ~
execute as @s[scores={svm_ep.previous_dimension=4}] in svm_ep:cherry_island run tp @s ~ ~ ~
execute as @s[scores={svm_ep.previous_dimension=5}] in svm_ep:pocket run tp @s ~ ~ ~
execute as @s[scores={svm_ep.previous_dimension=6}] in svm_ep:void run tp @s ~ 64 ~
execute at @s run function svm_ep:system/dimension/spread
scoreboard players operation @s svm_ep.previous_dimension = %OLD svm_ep.previous_dimension