Minecraft Java Edition – How to Make an Automatic Spawn Point When You Die

minecraft-commandsminecraft-java-edition

So for a map, I want to have the players re-spawn where they died so they can continue playing. I have a concept in my head that I can't quite figure out.

I was thinking of having an armor stand continue to tp to the player and set the spawnpoint to the armor stand, but my knowledge in this area is limited and I'm not sure how to go about this or if this would even work. I am not stuck on this concept and am open to other ideas.

Best Answer

You can always use a command block with the following setup:

enter image description here

Replace <name> with your name, obviously.

If you want to do this with all users on a single world, use the following command:

/spawnpoint @a

Make sure you turn off command block output, though, and also make sure you put this block in a permanently loaded chunk (your spawn chunks, for example). You may wish to use a setup involving repeaters instead of a repeating command block (as repeating command blocks act very quickly, and may cause lag). I'd generally suggest against doing this, however, because you don't prevent yourself from dying in a loop (which is not only possible, but probable in this).