/setworldspawn

/setworldspawn
Permission level
required
  • 2 ‌
  • 1 ‌
Restrictions

Cheat only‌

Sets the world spawn.

Usage

This command cannot be used to set the world spawn in any dimension other than the Overworld.

Spawn chunks are also changed along with the world spawn in Java Edition.

Normal spawn spreading still applies, and can be set with a gamerule.

Syntax

  • Java Edition
setworldspawn [<pos>] [<angle>]
  • Bedrock Edition
setworldspawn [spawnPoint: x y z]

Arguments

JE<pos>: block_pos
BE: spawnPoint: x y z: CommandPositionFloat

Specifies the coordinates of the world spawn. If not specified, defaults to the block position of the command's execution.
In Java Edition, <x> and <z> should be in the range of [-30000000, 30000000), and <y> should be in the range of [-20000000, 20000000).
In Bedrock Edition, <x> and <z> that are greater than 30,000,000 or less than -30,000,000 are reverted to 30,000,000 and -30,000,000 respectively; <y> values which are greater than 319 and less than -64 are reverted to 319 and -64 respectively.
In Java Edition:
Must be a block position composed of <X>, <Y> and <Z>, each of which must be an integer or a tilde and caret notation.
In Bedrock Edition:
Must be three-dimensional coordinates with single-precision floating-point number elements. Accepts tilde and caret notations.

JE: <angle>: angle

Specified the yaw angle to spawn with. Defaults to 0.0. This angle is ignored due to a bug.[1]
Must be a yaw angle, measured in degrees with single-precision floating-point numbers. -180.0 for due north, -90.0 for due east, 0.0 for due south, 90.0 for due west, to 179.9 for just west of due north, before wrapping back around to -180.0. Tilde notation can be used to specify a rotation relative to the execution yaw rotation.

Result

CommandTriggerJava EditionBedrock Edition
AnyThe command is incomplete, or any argument is not specified correctly. Unparseable Unparseable
The execution dimension is not the Overworld. Failed Failed
The <x> or <z> exceed the range of [-30000000, 30000000), or the <y> argument exceeds the range of [-20000000, 20000000). Successful
OtherwiseSuccessful

Output

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
AnyJava EditionOn fail000
On success111
Bedrock EditionOn fail0N/AN/A
On success1N/AN/A

History

Java Edition
1.7.213w43aAdded /setworldspawn.
1.16.220w29aAdded angle parameter for setting the default facing angle of a respawning player.
1.1721w10aNow /setworldspawn does not accept positions where <x> or <z> exceeds the range of [-30000000, 30000000), or <y> exceeds the range of [-20000000, 20000000)[2]
1.20.524w03aNow /setworldspawn success only in the Overworld. Before, if executed in another dimension, the command acts as if it succeeded, but the world spawn is not changed.
Pocket Edition Alpha
v0.16.0build 1Added /setworldspawn.

See also

References

  1. MC-200092 — /setworldspawn seems to ignore the 'angle' parameter
  2. MC-210408 — resolved as "fixed".

Navigation