mojira.dev
MC-60770

Spreadplayers with relatives coordinates does not work like spreadplayers with normal coordinates

As you can see here : http://imgur.com/Kx60Xta
The center point is not the same.
Explication :
It's due to the fact that the middle of the block is z = .5 and x = .5 and not an integer.
So the command with the coordinates ---> the coordinates get changed to the middle of the block.
Whereas with the relatives coordinates ----> just using integers as coordinates, so the middle of the range of the spreadplayer command is a coner of the block.

Comments 7

this is not a duplicate, it says that the range is diffrent, look at the image

This issue is easily noticeable when repeatedly running the following command: "execute @p ~ ~ ~ spreadplayers ~ ~ 1 3 false @p". The player consistently gravitates toward Northwest (the negative x/z directions).

This is still an issue in 1.8.1.

Here's how you can set things up to test.

Command block 1: summon ArmorStand ~ ~1 ~ {Invulnerable:1,NoGravity:1,CustomName:"StandTeleported"}

Command block 2: execute @e[name=StandTeleported] ~ ~ ~ spreadplayers ~ ~ 0 1 false @e[name=StandTeleported,c=1]

Run command block 1 a few times, then command block 2 on a clock. Watch as the armor stands head northwest.

Still an issue in 1.8.2 pre 3

Use
/execute @e[name=StandTeleported] ~ ~ ~ spreadplayers ~.5 ~.5 0 1 false @e[name=StandTeleported,c=1]
instead to work around the rounding bias

Using an offset of 0.5 in the spreadplayers coordinates will center it correctly around the block position that the execute command provides to spreadplayers in this case

Is this resolution still sensible for 1.13+ commands? This seems to have been changed in 1.13 so that relative coordinates work properly again with this command

Omeganx x

michael

Unconfirmed

Minecraft 14w27b, Minecraft 1.8.1, Minecraft 1.8.2-pre3

Retrieved