## Get last death location
execute store result score @s vb.dummy1 run data get entity @s LastDeathLocation.pos[0]
execute store result score @s vb.dummy2 run data get entity @s LastDeathLocation.pos[1]
execute store result score @s vb.dummy3 run data get entity @s LastDeathLocation.pos[2]

## Other dimensions
scoreboard players set @s vb.dummy4 0
execute if entity @s[nbt={LastDeathLocation:{dimension:"minecraft:overworld"}}] unless dimension minecraft:overworld run scoreboard players set @s vb.dummy4 99999
execute if entity @s[nbt={LastDeathLocation:{dimension:"minecraft:the_nether"}}] unless dimension minecraft:the_nether run scoreboard players set @s vb.dummy4 99999
execute if entity @s[nbt={LastDeathLocation:{dimension:"minecraft:the_end"}}] unless dimension minecraft:the_end run scoreboard players set @s vb.dummy4 99999

## No death location
execute unless data entity @s LastDeathLocation run scoreboard players set @s vb.dummy4 99999

## Display in action bar
execute unless score @s vb.dummy4 matches 99999 run title @s actionbar [{text:'X: ',color:white},{score:{name:'@s',objective:vb.dummy1},color:aqua},{text:' Y: ',color:white},{score:{name:'@s',objective:vb.dummy2},color:aqua},{text:' Z: ',color:white},{score:{name:'@s',objective:vb.dummy3},color:aqua}]
execute if score @s vb.dummy4 matches 99999 run title @s actionbar [{text:'X: ',color:white,obfuscated:true},{text:'000',color:aqua,obfuscated:true},{text:' Y: ',color:white,obfuscated:true},{text:'00',color:aqua,obfuscated:true},{text:' Z: ',color:white,obfuscated:true},{text:'000',color:aqua,obfuscated:true}]