## Get elevation
# Y position
execute store result score @s vb.dummy1 run data get entity @s Pos[1]
# Calculate
scoreboard players set @s vb.dummy2 62
scoreboard players operation @s vb.dummy1 -= @s vb.dummy2

## Other dimensions
scoreboard players set @s vb.dummy4 0
execute unless dimension minecraft:overworld run scoreboard players set @s vb.dummy4 99999

## Display in action bar
execute unless score @s vb.dummy4 matches 99999 if score @s vb.dummy1 matches 0.. run title @s actionbar [{text:'Elevation: ',color:white},{text:'+',color:gold},{score:{name:'@s',objective:vb.dummy1},color:gold}]
execute unless score @s vb.dummy4 matches 99999 unless score @s vb.dummy1 matches 0.. run title @s actionbar [{text:'Elevation: ',color:white},{score:{name:'@s',objective:vb.dummy1},color:gold}]
execute if score @s vb.dummy4 matches 99999 run title @s actionbar [{text:'Elevation: ',color:white,obfuscated:true},{text:'00',color:gold,obfuscated:true}]