Uploaded image for project: 'Minecraft (Bedrock codebase)'
  1. Minecraft (Bedrock codebase)
  2. MCPE-129058

Can't spawn in small spaces using spawnpoint command

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 1.19.0
    • 1.17.10, 1.16.221 Hotfix, 1.17.40
    • None
    • Confirmed
    • Windows
    • 654822

      The /spawnpoint command always sets the player's spawn point to integer coordinates. That centers the player on the intersection of four blocks. As a result, blocks to the north or west of the player spawnpoint can cause the player's position to be offset away from the intended respawn block when respawning. This can make it impossible to set a reliable player respawn points precisely. Moreover, it is not possible to work around this by using fractional coordinates because although the game accepts fractional coordinates as input, it truncates them to integers when saving the spawn point. It is also not possible to workaround by setting respawn radius to 0 because the problem is not the block check.

      1. Create a flat world
      2. /spawnpoint 0 4 -20
      3. Place solid blocks 2-high at 0, 4, -19; 0, 4, -21; 1 4 -20; and -1 4 -20.
      4. Change to survival mode.
      5. /kill @s

      Expected result

      You respawn at 0 4 -20, inside of 1 x 1 space surround by blocks..

      Actual result

      You respawn at -1, 4, -21, pushed out to the northwest by the blocks. Note that if you try this with a spawnpoint at 0, 4, 0 you will not see the bug because the player is pushed southeast instead of northwest from 0, Y, 0.


      If you are trying to use the spawnpoint command, it will not work consistently if you are spawning in a 1x1 block space enclosed by walls. For me, two consistent errors are the following coordinates: 0, 20, -20; 0, 20, 20. (Maybe it just needs to spawn in the center of the block?) You spawn just on the corner and then get pushed out.

      There are no corners, and I have the spawn set to the coords of that pressure plate. (0, 20, -20)

            TwoBytes Talon Klerekoper
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: