Commands/setworldspawn

Sets the world spawn.


 * Syntax


 * Java Edition


 * Pocket Edition


 * Arguments


 * x y z (PE: spawnPoint: x y z) (optional)
 * Specifies the coordinates of the world spawn. x and z must be within the range -30,000,000 to 30,000,000 (inclusive). y must be between 0 and 256 (inclusive). May use tilde notation to specify coordinates relative to the command's execution. If not specified, defaults to the position of the command's execution. Not optional in command blocks.


 * If the server is not in adventure mode, players will always spawn on the topmost block near (x,z) — y is effectively ignored. If the server is in adventure mode, then the new spawnpoint will be the coordinates given exactly, including the y coordinate (even if underground and even if there is no block there) -- if the y level given does not have space for the player then it will move up on the y axis until it does, at most y level 256.


 * Although spawn chunks are usually kept loaded at all times, new spawn chunks won't be loaded by this command until a player moves within range. Compasses (which in Minecraft point to the world spawn rather than north) will also not update to the change until the world is reloaded.


 * Result


 * Fails if the arguments are not specified correctly.


 * On success, sets the world spawn to the specified coordinate.