Minecraft – How to put players in a specific spot on joining the game

minecraft-java-edition

I am trying to make a kit pvp map, and when players enter the game they are supposed to spawn on a floating platform, but they just spawn where they left the game last.

If a player dies they spawn at the right spot, but not when they enter the game.

Also, is there anyway to change the direction you point in when you spawn?

Best Answer

  1. Add a new objective that tracks when the game has been quit:

    /scoreboard objectives add GameQuit stat.leaveGame

  2. On a redstone block clock, have these two commands in this order:

    tp @a[score_GameQuit_min=1] X Y Z XROT YROT

    scoreboard players set @a[score_GameQuit_min=1] GameQuit 0

enter image description here

Replace X Y Z with the coordinates you want the player to log in on, and XROT YROT with the rotation you want them to log in on.