Only X and Z, no Y: the game finds the ground height itself. Tilde notation works, so ~ ~ centers the spread on whatever runs the command.
Spacing is the minimum gap between spread targets. Max range is how far from the center anyone can land along each axis, so the spread area is a square 1,000 blocks on a side. At these numbers the area holds at most about 121 spread points; keep your target count well below that so the random placement can succeed.
The height limit exists for the Nether: without it the command picks the highest block at each spot, which puts players on top of the bedrock roof. under 100 keeps a Nether scatter inside the caves. It also works for underground arenas.
/spreadplayers accepts any entities, not just players: @a for everyone, @a[team=red] for one team, or @e[type=armor_stand] to scatter markers across a map.
Spreads @a across a 1,000 by 1,000 block square centered on 0 0, keeping at least 100 blocks between targets.
Needs cheats: /spreadplayers requires permission level 2 (gamemasters). Run it from chat with cheats on, from a command block, or from the server console.
The /spreadplayers command teleports players or entities to random, evenly spaced ground positions around a center point. It is the standard way to scatter players at the start of UHC, battle royale and survival games, and it needs permission level 2: cheats on, a command block, or the server console.
You give the command four things: a center as x z coordinates, a spread distance that sets the minimum gap between targets, a max range that limits how far from the center anyone can land, and the targets to move. The game then picks random points inside a square twice the max range on a side, shuffles them until every pair respects the spacing, and teleports each target onto the highest solid block at its point. Targets are never placed in water, lava or fire, and every landing spot stays inside the world border.
There is no Y coordinate in the command because the game resolves the ground height itself. That is also why the optional under branch exists: in the Nether the highest block at almost every spot is the bedrock roof, so capping the search height with under keeps the scatter inside the caves where it belongs.
Use the generator above to compose the command: set the center and the two numbers, tick the team and height options if you need them, pick the targets, and copy the result into chat or a command block. The output panel warns you when a combination is one Minecraft would reject.
The full syntax is /spreadplayers <x> <z> <spreadDistance> <maxRange> [under <maxHeight>] <respectTeams> <targets>. Only the under branch is optional:
Commands you can copy directly:
One rule trips up almost everyone: the max range must be at least 1 block bigger than the spread distance. A command like /spreadplayers 0 0 50 50 false @a always fails, because a 100 by 100 square cannot guarantee 50 blocks between targets at its edges. The generator flags this combination before you copy it.
The classic use is the UHC or battle royale start: one command block wired to the start button runs something like /spreadplayers 0 0 100 500 false @a, and every player begins the game alone at a random point in a 1,000 by 1,000 block square. No two players start within 100 blocks of each other, so nobody gets an unfair early fight.
Getting the two numbers right is mostly capacity math. The spread area is a square twice the max range on a side, and the number of points that can fit at a given spacing grows with the square of the ratio between them. As a rule of thumb, keep your player count well below the theoretical maximum the generator shows for your numbers: the placement is random, so a nearly full area makes the command slow or makes it fail outright with a too many entities for space error.
For team games, set respectTeams to true so each scoreboard team spawns together and the spacing applies between teams. Remember the quirk: every player who is not on a team counts as one shared group, so assign teams with the /team command before the scatter or the teamless players will all pile onto the same block.
Two more tricks worth knowing. First, the under branch is mandatory for Nether games: without it the command places players on top of the bedrock roof, since that is the highest block at nearly every point. Second, the command spreads any entities, not just players: scattering armor stands gives you a set of random, evenly spaced positions you can teleport to, mark with structures, or use as loot spawn points when building a map.
It teleports players or entities to random, safe ground positions spread around a center point. You give it a center (x z), a minimum spacing between targets and a maximum range, and the game finds spots on solid ground that satisfy both. It requires permission level 2, so it works from chat with cheats on, from command blocks and from the server console.
The first number is the spread distance: the minimum gap in blocks between spread targets. The second is the max range: how far from the center a target can land along each axis, which makes the spread area a square twice that value on a side. The max range must be at least 1 block bigger than the spread distance or the command fails.
The usual causes: the max range is not at least 1 bigger than the spread distance, the area is too small to fit every target at the required spacing (the error suggests using a smaller distance), the center is outside the world border, or there is no valid ground because every candidate spot is liquid. Raise the range, lower the spacing or move the center, then run it again.
Set the respectTeams argument to true. Every member of the same scoreboard team is teleported to the same spot, and the spacing applies between teams instead of individual players. Watch out for one quirk: all players who are not on any team count as a single group and land together, so put everyone on a team before running a team scatter.
The under branch caps the highest Y level the command considers when picking ground, written as under followed by a whole number before the respectTeams argument. Without it the command always lands targets on the highest block at each spot, which in the Nether means the top of the bedrock roof. under 100 keeps a Nether scatter inside the caves, and the same trick works for underground arenas.
Yes. The targets argument accepts any entities, not just players. /spreadplayers 0 0 20 200 false @e[type=armor_stand] scatters armor stands across the area, and the same works for mobs or item frames. Map makers use this to generate random loot points, spawn markers or patrol positions with a single command.
Need to send everyone to one exact spot instead? Or browse more Minecraft tools: