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.
Create a flat world
/spawnpoint 0 4 -20
Place solid blocks 2-high at 0, 4, -19; 0, 4, -21; 1 4 -20; and -1 4 -20.
Change to survival mode.
/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)
Linked issues
Attachments
Comments 5
Yes. As of 1.17.10: When I try to spawn in a box without corners, the middle being 0, 20, 20 like in the picture, I spawn in and it pushes me out to -1 20 19, because I spawned in the very corner (0, 20, 20,) not the middle (0.5, 20, 20.5)
This issue was fixed at some point last year, but the same behavior still affects /setworldspawn as reported in MCPE-175620.
Is this still an issue in the latest version? If so, can you please add it to the affected versions (or mention it if you are not the reporter).
This ticket will automatically reopen when you reply.