Using Minecraft command blocks to automatically TP players when they join?

Using Minecraft command blocks to automatically TP players when they join? - Crop hacker silhouette typing on computer keyboard while hacking system

I am trying to make a Hunger Games map on MC 1.5.2 and I am almost finished. I have most of the command blocks set ready for the games but for some reason, everyone keeps spawning on top the glass sphere and not in the lobby I made. Even after I changed the spawnpoint and did /kill, I still spawned on top of the sphere so to counteract that, I made a TP command block which TPs all people to the lobby. Though what I want is something that can TP each person to the lobby when they join, automatically, so that they don't spawn on top the sphere without them being able to get to the lobby and having me to manually press the TP all to lobby button.

So, any suggestions on how I can make an Auto-TP when people join my server?



Best Answer

To make them automatically teleport down to where you want them you can use the /execute command. If you type this:

/execute @a[r=2] ~ ~ ~ tp @p (coordinates of where you want them to spawn go here)

into a repeat/purple command block that is set to always active and that is within two blocks of where the players spawn then it should work. It worked for me when I had the same problem, but if you play Java it might not work because I play Bedrock.




Pictures about "Using Minecraft command blocks to automatically TP players when they join?"

Using Minecraft command blocks to automatically TP players when they join? - White Metal High-rise Viewing Deck Building
Using Minecraft command blocks to automatically TP players when they join? - From above of crop anonymous male hacker typing on netbook with data on screen while sitting at desk
Using Minecraft command blocks to automatically TP players when they join? - From below of ethnic boy in hoodie controlling robot using panel while standing in light room



How do you teleport players using command blocks?

Type this command in when having the command block GUI open /teleport @p <x> <y> <z> . Then, activate the command block with redstone (including buttons, levers, and pressure plates), and they will be sent to their destination. The player can set up multiple different teleports.

How do you run a command when a player joins Minecraft?

If you only want it to run the command the first time they join, try this:
  • Run this in the chat: /scoreboard objectives add joined dummy.
  • In command blocks on a fill clock: /scoreboard players add @a joined 0 /execute @a[score_joined=0] ~ ~ ~ [command you want to run]


  • How do you allow all players to teleport in Minecraft?

    What to Know
  • Enable cheats in your world's settings, open the chat window, and enter the Tp command. For example: /tp yourName.
  • If successful, you will receive a confirmation message and be teleported to the indicated location.
  • You can teleport anyone or anything anywhere with the Tp command.




  • Welcome Message on Login - Minecraft Command Block Tutorial [1.14+]




    Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

    Images: Anete Lusina, Pixabay, Sora Shimazaki, Vanessa Loring