1

how to set a exact spawn point with commandblocks

1 emerald 15 replies 360 views | started 07/17/2017 6:38 pm by xXka3lXx
hello, i've seen this question a lot before and i finally found an answer. when you do
/set worldspawnpoint it makes you spawn within 30 blocks from the desired point. if you want to spawn in a specific spot you need a repeating command block. you can get this by doing /give [username] minecraft:repeating_command_block. then place it and turn it to always active. then type /testfor @a. now press done then put a comparator facing away from it then put a regular commandblock in front of it. you can get this by doing
/give [username] minecraft:command_block. then type /tp @a [x] [y] [z]. to test if it works log off the world then go back on. you should be at the exact coordinates you put in the second command block. i hope this helped you.

EDIT: ive seen this in the comments 2 times already so if you want to make it so you spawn in creative/adventure/spectator then add another commandblock next to the commandblock with the tp command in it. then type in /gamemode [gamemode]

the easiest way i found in the comments was by Gealx3 he said turn /gamerule spawnRadius 0 which i find the easiest way to do this.
Posted by avatar
xXka3lXx
Level 9 : Apprentice Miner
3

15 replies

1
07/20/2017 3:21 pm
Level 1 New Crafter
BenceTheGreat
avatar
I have no idea what that does but it probably works
2
07/20/2017 3:10 pm
Level 22 Expert Engineer
Qianna
avatar

/setworldspawn posX posY posZ
/gamerule spawnRadius 0 /* Spread radius = 0, equal to exact posX posY posZ */

/* If player specific spawnpoint is required: */
/spawnpoint @p[<insert_parameter_here>] diffPosX diffPosY diffPosZ

"/spawnpoint" overrides default spawn point (worldspawn) for each player entry, and sets to the exact position (diffPosVar).
"... spawnRadius 0" overrides default spread from spawn point to 0 (as explained, to exact posVar positions).
There's absolutely no reason to constantly loop commands.
1
07/20/2017 3:05 pm
Level 1 New Crafter
BenceTheGreat
avatar
Ok! Well then I guess this answers the question...
1
07/20/2017 2:57 pm
Level 1 New Miner
DiAma_Luffy
avatar
yes of course you can because the command block use the command like the chat with "/" but in command block you don't need to place "/"
1
07/20/2017 1:57 pm
Level 1 New Crafter
BenceTheGreat
avatar
But can you use it in a command block?
1
07/20/2017 12:24 pm
Level 14 Journeyman Crafter
RSMike
avatar
you can run /spawnpoint @a <X,Y,Z> in an always active repeating command block you know
1
07/20/2017 1:55 pm
Level 30 Artisan Engineer
Bertiecrafter
avatar
Gealx3's answer is still better because it doesn't override player specific spawns.
2
07/19/2017 12:03 am
Level 54 Grandmaster Artist
Gealx3
avatar
You could just do /gamerule spawnRadius 0. The only time that wouldn't work is if you wanted the spawn point underground or under a ceiling of some kind though.
1
07/20/2017 8:17 am
Level 30 Artisan Engineer
Bertiecrafter
avatar
Wow, this is probably the best solution so far. I thought the spawnRadius only meant the amount of loaded chunks, but indeed it's the spread radius. Confirmed by the minecraft wiki.

Compared to other solutions, this doesn't have initial commands AND doesn't ignore player specific spawnpoints. So yeah, this is probably the best solution.
1
07/18/2017 3:45 pm
Level 30 Artisan Engineer
Bertiecrafter
avatar
WARNING
THIS IS NOT WORKING AND COULD BUG YOUR WORLD

What you are doing is basically testing if anyone is there. If there is, you would be tped once. So everytime the server goes empty, the test returns false. Next time anyone joins he will be tped to that location. This has nothing to do with whether or not you die.

Instead, use /defaultgamemode adventure to make sure everyone spawns exactly at the worldspawn instead of around it (IF they have no spawnpoint yet).

----

Also, you can use the following commands to make the players spawn at a certain point, ignoring player spawns and removing the trouble of doing /gamemode for each new player.
Once:
/scoreboard objectives add death deathCount

On clock:
/tp @a[score_death_min=1] [x] [y] [z]
/scoreboard players reset @a[score_death_min=1] death
1
07/19/2017 9:19 pm
Level 9 Apprentice Miner
xXka3lXx
avatar
1. it hasnt buged for me
2. this is mainly for map makers so people will spawn in the spawn room so it shouldn't matter if you die. if they wanted people to spawn somewhere else once the player dies the way you suggest could be a better way but this is just so they spawn into the world in the right place.
3.if you do /defaultgamemode adventure you would spawn at the point the world automatically sets it to which means you will have to get mcedit and thats impossible to get if your a linux user like me
4.the death count way could be used for regular survival but if your a map maker you would re spawn in the start room so every time the player dies he/she will need to start over
1
07/20/2017 8:21 am
Level 30 Artisan Engineer
Bertiecrafter
avatar
1. okay
2. This was not clear from your story, spawning includes reviving after death. And besides, if you re-load the world (e.g by going back to the menu on Single Player) this DOES indeed trigger again and teleport the player AGAIN.
3. You can do /setwoldspawn.
4. This is not just for survival, it's for any map including a respawn after death. You are right about the coordinates not being changeable, but the same goes for your solution. Your /tp command is just as static as my /tp command applied in different situations.
1
07/18/2017 1:24 am
Level 19 Journeyman Ranger
Greystalk
avatar
Um, you know there's a /spawnpoint command right? Or am I missing something?
1
07/19/2017 9:21 pm
Level 9 Apprentice Miner
xXka3lXx
avatar
when you do
/set worldspawnpoint it makes you spawn within 30 blocks from the desired point.
and if you do just /spawnpoint then you will have to do it for every individual player that comes on
1
07/18/2017 3:50 pm
Level 30 Artisan Engineer
Bertiecrafter
avatar
This is also a solution, but it requires to set the spawnpoint every time.
Compared to the solutions above:

Defaultgamemode solution:
- Requires command for new players (/gamemode)

Scoreboard solution:
- Ignores playerspawns

Spawnpoint solution:
- Requires command for new players (/spawnpoint)

Search

Browse

Site

© planetminecraft.com

Welcome