PT-BR EN ES
Channel Icon

Crazy Ozz

Official Channel Website

Command Block

How to See Your Last Death Coordinates in Minecraft

Minecraft Java Edition 1.21+ and 26+ – LastDeathLocation + Scoreboard + Tellraw

In this tutorial, you will learn how to see the coordinates of your last death in Minecraft using command blocks. This method works in Minecraft Java Edition 1.21+ and 26+ and uses the LastDeathLocation NBT data to get the exact X, Y, and Z coordinates. Then we store the values in a scoreboard and display them in chat using the tellraw command. This is perfect for servers, hardcore worlds, minigames, and adventure maps.

Step 1: First, let's create 3 scoreboards that will be used to store the X, Y, and Z coordinates

scoreboard objectives add deathPosX dummy

scoreboard objectives add deathPosY dummy

scoreboard objectives add deathPosZ dummy

Step 2: Place 3 command blocks in a row. The first one should be an Impulse block with a button, followed by 2 Chain blocks. Set the Chain blocks to "Always Active"

Use the following commands in each, following the order the command blocks were placed:

execute store result score @p deathPosX run data get entity @p LastDeathLocation.pos[0]

execute store result score @p deathPosY run data get entity @p LastDeathLocation.pos[1]

execute store result score @p deathPosZ run data get entity @p LastDeathLocation.pos[2]

These commands will store the coordinates of the player's death into the scoreboard

Keep in mind that this will only work for the nearest player; you can change @p to a specific player's name or to something like @e[tag=test], for example

You can also use a Repeat block instead of an Impulse one if you want to update the coordinates constantly instead of pressing the button each time

Step 3: Let's display the coordinates of where the player died in the chat using the tellraw command

Place this command in an Impulse command block with a button, and press it to see the result!

tellraw @p ["",{"text":"Death Coordinates: ","color":"red"},"\n",{"text":"X: ","color":"yellow","bold":true},{"score":{"name":"@p","objective":"deathPosX"},"color":"green"},"\n",{"text":"Y: ","color":"yellow","bold":true},{"score":{"name":"@p","objective":"deathPosY"},"color":"green"},"\n",{"text":"Z: ","color":"yellow","bold":true},{"score":{"name":"@p","objective":"deathPosZ"},"color":"green"}]

Want cheap and lag-free Minecraft hosting?

I recommend Sparked Host: affordable plans, great performance, easy panel and fast support.

🚀 Start your Minecraft Server

Still have questions? Watch the video below