I have a question I think someone who's been playing MC longer then I have might be able to answer. I'm looking to build a multiplayer server, if you will, and I want to be able to cover the spawn area. What I mean is that I want everyone who joins to spawn inside a specific building which is built around the global spawn point. The question is, is this possible? I've read the wiki about spawning, but I may have just missed something about what I'm wanting to do.
From what I know it is not possible to get a player to spawn "in" a house however it is possible to have them spawn on a platform that you have built as long as there is not roof over it this is because the player will spawn in the highest point of the spawn chunk which is a 20x20 block square over the point (0,0) on the map. So the square extends from -10 to 10 on the X origin and -10 to 10 on the Y origin. This is at least how I understand it. You might want to do some tests on a super flat to be sure.
I don't believe I've ever entered a new game anywhere near the middle of the map... but the default spawn area should be the same for all new players as it is for the host when the world is generated. I think it is chunk based, so it is probably more of the highest (Y coordinate) point on a 16x16 area (between X and Z coordinates that are evenly divisible by 16 ... for simplicity sake).
Get your starting coordinates off your map.
Divide both the X and Z coordinates by 16 and discard the remainder.
Multiply the result back to 16 again (without the remainder, this gives you the lower range if X/Z is positive or the upper range if negative).
To Find the upper range (if X or Z is positive), add 16 to this result, or for the lower range, subtract 16 to this result (if X or Z is negative).
Example:
Spawned in at X= 23, Y= 65, Z= -279.
X : 23/16 = 1 R 7 => 1 * 16 = 16 ... (since positive) up to 16 + 16.
X Range for spawn area should be : 16 to 32
Z : -279/16 = -17 R (-7) => -17 * 16 = -272 ... (since negative) down to -272 - 16.
I have a question I think someone who's been playing MC longer then I have might be able to answer. I'm looking to build a multiplayer server, if you will, and I want to be able to cover the spawn area. What I mean is that I want everyone who joins to spawn inside a specific building which is built around the global spawn point. The question is, is this possible? I've read the wiki about spawning, but I may have just missed something about what I'm wanting to do.
- Get your starting coordinates off your map.
- Divide both the X and Z coordinates by 16 and discard the remainder.
- Multiply the result back to 16 again (without the remainder, this gives you the lower range if X/Z is positive or the upper range if negative).
- To Find the upper range (if X or Z is positive), add 16 to this result, or for the lower range, subtract 16 to this result (if X or Z is negative).
Example:Spawned in at X= 23, Y= 65, Z= -279.