execute store result entity @s Pos[0] double 1 run data get entity @a[tag=graved,limit=1] LastDeathLocation.pos[0]
execute store result entity @s Pos[1] double 1 run data get entity @a[tag=graved,limit=1] LastDeathLocation.pos[1]
execute store result entity @s Pos[2] double 1 run data get entity @a[tag=graved,limit=1] LastDeathLocation.pos[2]

execute at @s align xyz positioned ~.5 ~.1 ~.5 run tp @a[tag=graved] ~ ~ ~
execute as @a[tag=graved] if data entity @s LastDeathLocation{dimension:"minecraft:overworld"} at @s in minecraft:overworld run tp @s ~ ~ ~
execute as @a[tag=graved] if data entity @s LastDeathLocation{dimension:"minecraft:the_end"} at @s in minecraft:the_nether run tp @s ~ ~ ~
execute as @a[tag=graved] if data entity @s LastDeathLocation{dimension:"minecraft:the_end"} at @s in minecraft:the_end run tp @s ~ ~ ~
execute as @a[tag=graved] if data entity @s LastDeathLocation{dimension:"survivalplus:final_destination"} at @s in survivalplus:final_destination run tp @s ~ ~ ~
execute as @a[tag=graved] if data entity @s LastDeathLocation{dimension:"survivalplus:backrooms"} at @s in survivalplus:backrooms run tp @s ~ ~ ~
#execute unless data entity @a[tag=graved,limit=1] LastDeathLocation.dimension run tellraw @a[tag=graved] {"text":"Unkown dimension!","color":"red"}

execute at @s run playsound minecraft:entity.evoker.cast_spell player @a ~ ~ ~
execute at @s run particle soul ~ ~1 ~ .2 .3 .2 .1 30
execute at @s run particle explosion ~ ~1 ~ .2 .3 .2 .1 5
kill @s