Forum: gaming.stackexchange.com
Tags: <minecraft-java-edition>
Title: setworldspawn is not spawning players to the exact place
Question: I am trying to make a Minecraft map but I can't set the world spawn. I did  /setworldspawn  then  /kill  and I ended up 10 blocks away then I tried again I was still 5 blocks away.   In the map it needs to keep updating your spawn point and having it not not working correctly is not an option. In one case I set the spawn, and then ended up in the next level of my map, which is clearly not intended.

Answers:
sents: text: Look at the Minecraft-Wiki entry for Spawn .
text: Player Spawning Since Minecraft version 1.3, players in both singleplayer and multiplayer will spawn, by default, anywhere within a 20x20 area centered at the world spawn point .
text: An individual player can change their spawn point by merely lying in a bed—they do not have to go to sleep (which can only happen if all players use a bed at the same time).
text: Unlike spawning at the world spawn, a player's spawn point is set at specific coordinates; the player will always respawn on the same block.
text: This block is also where the player is placed when the player gets out of the bed.
text: If there are transparent blocks over the spawn block, the player will be respawned on top on the blocks, but will get out of bed inside of them on the same level as the bed.
text: Emphasis mine.
text: Setting only the worldspawn will not help you ,you need to set the players' spawnpoints.
text: So the command you should be using instead is /spawnpoint <player>
text: <x
text: > <y
text: > <z> which will actually set the spawnpoint as if sleeping in a bed
text: (see Commands ).
text: Just use @a to set it for every player at once.
text: As Rokk points out, this will not work for "Lobby" areas (i.e. where you will spawn when you first enter the world as a new player), since you need to run it for every player, and you can't run it before a player first spawns.
text: For this case, I suggest a sufficiently large (i.e. 20x20 or greater) spawning area, set with /setworldspawn .
text: Note that you spawn on the top blocks in the set area, so building it underground will not work.
answer_details: author: gaming.stackexchange.com/users/74333/MrLemon
score: 10
sents: text: Try using the a repeater with a command block that states: " /spawnpoint @a[r=<size of spawn from the center, outwards>] <
text: x> <y> <z> " This will ensure that people within the specified area (within the [r=
text: <>] circle) will have their spawnpoints set to the coordinates and as soon as they leave the range, they can set their spawnpoint anywhere else.
text: No pressure plates or tripwires required.
answer_details: author: gaming.stackexchange.com/users/117526/framzero
score: 4
sents: text: Try /gamerule spawnRadius false
answer_details: author: gaming.stackexchange.com/users/192086/user192086
score: 4
sents: text: You could set the default gamemode to adventure mode (in adventure, minecraft spawns the player directly on the block) and then put a pressure plate at the spawn point and set the player to survival or creative.
answer_details: author: gaming.stackexchange.com/users/128545/THE EMERALD TRACK
score: 2
sents: text: While MrLemon's answer is probably the best way to go, you will have to repeat it every time a new player joins for the first time.
text: I suggest installing Bukkit and using a plugin to set a specific spawn.
text: Alternatively, you could just make the spawning area 20x20.
answer_details: author: gaming.stackexchange.com/users/79446/Hugo Zink
score: 1
sents: text: As MrLemon pointed out, players always spawn randomly in a 20x20 area around the world spawn.
text: If you want to set each player's spawn point to a specific location, you could put the world spawn point in the middle of a 20x20 area of tripwires, which then activate command blocks setting the spawn point of all the players inside the area to wherever you want it to be, and then teleport them there.
text: It's what many minigames do.
answer_details: author: gaming.stackexchange.com/users/80646/ethanwu10
score: 1
sents: text: One way i do it is to have a repeater constantly repeating /spawnpoint @a ~ ~ ~ the whole time until they leave spawn and go over a pressure plate that uses setblock commands to disrupt the redstone clock repeating the spawnpoint command and then after leaving spawn they are free to set spawn where ever they want!
text: kind of technical but not really.
answer_details: author: gaming.stackexchange.com/users/105538/tree_puncher5
score: 1
sents: text: What I do is have the first time players on my Realms Server spawn in a huge square, and when they leave they step over a pressure plate that sets their spawn.
text: Try that, you might like it.
answer_details: author: gaming.stackexchange.com/users/115311/user115311
score: 0

Summary of the answers:
Set default gamemode to adventure mode, install Bukkit and use a plugin to set a specific spawn. 
There isn't a simple or a specific way to spawn players in exact positions. Furthermore, while there are plenty ways to do it, the most common are to either use mods or use presure plates in combination with redstone.