Skip to content

Instantly share code, notes, and snippets.

@Skinner927
Last active July 21, 2025 02:43
Show Gist options
  • Save Skinner927/28b1838520ce52cc6baeb61a00e9c608 to your computer and use it in GitHub Desktop.
Save Skinner927/28b1838520ce52cc6baeb61a00e9c608 to your computer and use it in GitHub Desktop.
Minecraft Command Block Death Location
All these block should feed into eachother. Meaning the first block should points at the second, and so on.
Repeat | Unconditional | Always active
execute as @a[nbt={Health:0.0f}] store result score @s lastpos_x run data get entity @s Pos[0]
Chain | Conditional | Always active
execute as @a[nbt={Health:0.0f}] store result score @s lastpos_y run data get entity @s Pos[1]
Chain | Conditional | Always active
execute as @a[nbt={Health:0.0f}] store result score @s lastpos_z run data get entity @s Pos[2]
Put a comparator between these blocks with output pointed at the impulse block
Impulse | Unconditional | Needs redstone
execute as @a[nbt={Health:0.0f}] run tellraw @a ["",{"selector":"@s"}," died at ( ", {"score":{"name":"@s", "objective":"lastpos_x"}}, ", ", {"score":{"name":"@s", "objective":"lastpos_y"}}, ", ", {"score":{"name":"@s", "objective":"lastpos_z"}}, " )"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment