Spreadplayers Command Generator — /spreadplayers Scatter Players or Mobs (Java Edition)
Most of these need operator permission — run them from an op's chat, a command block, or the server console.
How to Use the Spreadplayers Command Generator
- Set the Center X/Z – the horizontal point everyone gets scattered around (there’s no Y; the game finds the surface height itself).
- Set Spread distance (minimum gap enforced between each spread-out target) and Max range (how far from center the search area extends).
- Optionally cap it under max height, and choose whether to respect teams (keep teammates grouped together at one point instead of splitting them up).
- Enter the Targets selector – commonly
@afor every player, or an entity selector for mobs. - Copy the generated
/spreadplayerscommand into a command block, the console, or an operator’s chat.
Command Syntax Reference
/spreadplayers <x> <z> <spreadDistance> <maxRange> [under <maxHeight>] <respectTeams> <targets>
The command picks random points within a square region of side 2 × maxRange centered on (x, z), then repeatedly adjusts them so every pair of targets ends up at least spreadDistance blocks apart, teleporting each target to solid ground at its assigned point. If maxRange is too small to fit everyone at the requested spreadDistance, the command automatically shrinks the spread distance and reports it, rather than failing outright. The optional under <maxHeight> clause caps how high a valid landing surface can be, which is useful for keeping players off mountain peaks or floating structures. With respectTeams set to true, players on the same scoreboard team land together at one shared point instead of being scattered individually.
Frequently Asked Questions
What happens if the spread distance doesn’t fit in the max range?
The command automatically reduces the effective spread distance as far as needed to fit everyone within the given range, and reports the adjusted distance in its output – it won’t simply fail or refuse to run.
Does spreadplayers work on mobs, or only players?
It works on any entity, not just players – the targets argument accepts any valid selector, so /spreadplayers 0 0 5 50 true @e[type=minecraft:zombie] scatters zombies around a point exactly the same way it would scatter players.
What does “respect teams” actually change?
When set to true, every player belonging to the same scoreboard team is treated as one group and lands together at a single shared point, rather than being spread apart individually like players with no team. Set it to false to scatter everyone independently regardless of team.
Why is there no Y coordinate in the center point?
Spreadplayers only needs a horizontal center (X, Z) because it automatically finds a safe, solid landing height at each generated point – you don’t control vertical placement directly, though under <maxHeight> lets you cap how high that automatically-found surface is allowed to be.
Related Tools
- Teleport Command Generator – move one specific entity to an exact position instead of scattering a group.
- Spawnpoint Command Generator – set individual respawn points after players have been spread out.
- Tag Command Generator – mark scattered players/mobs with a tag for later selector targeting.