mojira.dev
MC-50548

/spreadplayers does not distance entities optimally from each other, limiting the number of entities that can be spread in an area

I am currently attempting to spread entities using the following command:

/spreadplayers -20 -9 2 3 false @e[type=Chicken]

With this distribution, the maximum number of entities that it should be able to spread is 16 (see image 1 - green spaces indicate valid positions under optimal spacing). However, that spreadplayers command will not work with more than 12 entities (I've run it ~200 times with 13 chickens and it has yet to succeed).

Steps to replicate:

1. Summon 13 chickens:

/summon Chicken -7 56 6 {Invulnerable:1,Attributes:[{Name:generic.movementSpeed,Base:0}]}

2. Set up a spreadplayers command block using the command:

/spreadplayers -20 -9 2 3 false @e[type=Chicken]

3. Run the spreadplayers command block.

Linked issues

Attachments

Comments 2

I can confirm this happening in 1.8.1. Attempt this command "/spreadplayers 0 0 1 2 false @e" with 25 entities. The area is 5x5, so it should work, but it doesn't.

magib1

(Unassigned)

Confirmed

Commands

Minecraft 14w10c, Minecraft 14w18a, Minecraft 1.8.1, Minecraft 15w33b, Minecraft 15w33c, Minecraft 16w42a, 20w07a, 1.20.2

Retrieved