Commands/spreadplayers

Teleports entities to random surface locations within an area.

Syntax

 * Java Edition
 * Spreads players to resulting position under the maximum height.
 * Spreads players to resulting position under the maximum height.
 * Spreads players to resulting position under the maximum height.


 * Bedrock Edition

Arguments

 * and
 * Specifies the center of the region to spread targets to.
 * Specifies the center of the region to spread targets to.
 * Specifies the center of the region to spread targets to.


 * And it must be at least 0.0.
 * Specifies the minimum distance between targets.


 * $$, it must be at least 1.0 greater than.
 * Specifies the maximum distance on each horizontal axis from the center of the area to spread targets (thus, the area is square, not circular).


 * Specifies the maximum height for resulting positions.
 * Specifies the maximum height for resulting positions.
 * Specifies the maximum height for resulting positions.


 * Specifies whether to keep teams together. If, targets on the same team are teleported to the same location.
 * Specifies whether to keep teams together. If, targets on the same team are teleported to the same location.
 * Specifies whether to keep teams together. If, targets on the same team are teleported to the same location.


 * Specifies the targets to spread.
 * Specifies the targets to spread.

Note
Targets are always placed on the top block at a location (if not in  mode), and never on lava.

The command does not have a uniform distribution over the surface. It has a Gaussian distribution as the positions closer to the position set in the command have a higher chance of having an entity on them. This effect is very subtle and is not visible for short radius but can be a problem if you want a uniform random generation. This problem does not occur for the @r selector and dispensers.

Examples

 * To teleport all players by team to random surface locations in a 1,000×1,000-block area centered on (0,0), with a minimum distance between teams of 200 blocks:
 * To teleport one random player from each of three teams (Red, Blue, and Green), as well as Alice and Bob, to random surface locations in a 200×200-block area centered on (0,0), with a minimum distance between players of 50 blocks:
 * To teleport one random player from each of three teams (Red, Blue, and Green), as well as Alice and Bob, to random surface locations in a 200×200-block area centered on (0,0), with a minimum distance between players of 50 blocks:

History
Befehl/spreadplayers Команды консоли/spreadplayers Команди консолі/spreadplayers 命令/spreadplayers