Skip to main content

/spreadplayers

Distributes entities randomly across an area. Useful for minigames, random spawn placement, and similar applications.

Category
World
Permission Level
Game Master
Version Added
1.6

Overview

Distributes entities randomly across an area. Useful for minigames, random spawn placement, and similar applications. In vanilla Minecraft Java Edition it is one of the world commands and has been available since version 1.6.

It is invoked as /spreadplayers

[under ] and accepts 5 required arguments (
, , , , and ) and one optional argument ([maxHeight]).

Entities are placed on the highest solid block at each position. The 'under' parameter (added in 1.16) restricts placement to below a certain height, useful for cave games.

Entities land on the highest solid block at each chosen point; the optional 'under ' clause (added in 1.16) keeps placement below a ceiling, which suits cave-based minigames.

Syntax & Arguments

/spreadplayers <center> <spreadDistance> <maxRange> [under <maxHeight>] <respectTeams> <targets>

The full syntax is /spreadplayers

[under ] . Angle brackets < > mark required arguments and square brackets [ ] mark optional ones; a vertical bar | between words means you pick exactly one of those literals. You must always supply
, , , , and . The argument [maxHeight] may be omitted, in which case the documented default applies.

center
Required, of type a vec2. The center point (x z) of the spread area.
spreadDistance
Required, of type a float. The minimum distance between spread entities.
maxRange
Required, of type a float. The maximum distance from the center that entities can be spread to.
maxHeight
Optional, of type an integer. Maximum Y height for placement (used with 'under' keyword).
respectTeams
Required, of type a boolean. If true, players on the same team are placed together.
targets
Required, of type an entity. The entities to spread.

Parameters

NameTypeRequiredDescription
centervec2RequiredThe center point (x z) of the spread area.
spreadDistancefloatRequiredThe minimum distance between spread entities.
maxRangefloatRequiredThe maximum distance from the center that entities can be spread to.
maxHeightintegerOptionalMaximum Y height for placement (used with 'under' keyword).
respectTeamsbooleanRequiredIf true, players on the same team are placed together.
targetsentityRequiredThe entities to spread.

Examples

The 3 examples below are ready to copy and adapt. For instance, /spreadplayers 0 0 10 100 false @a spreads all players randomly within 100 blocks of 0,0 with at least 10 blocks between each player. Each example varies the arguments to show a different real use of /spreadplayers; read the note under every snippet to see exactly what changes.

/spreadplayers 0 0 10 100 false @a

Spreads all players randomly within 100 blocks of 0,0 with at least 10 blocks between each player.

/spreadplayers 0 0 5 50 true @a

Spreads all players within 50 blocks of center, keeping teammates together.

/spreadplayers ~ ~ 3 20 under 100 false @a

Spreads players around your position, ensuring placement below Y=100.

Permission Level & Requirements

/spreadplayers sits at permission Level 2 - Game Master / Cheats, which means it needs permission level 2, the level cheats grant to single-player worlds and that operators hold by default.

In a single-player world you must have "Allow Cheats" turned on (or open the world to LAN with cheats) before it will run; on a multiplayer server the player needs to be an operator at the matching level.

This reference describes the Java Edition 1.21 form of the command; Bedrock Edition may use slightly different argument formats.

Common Mistakes

Notes

Entities are placed on the highest solid block at each position. The 'under' parameter (added in 1.16) restricts placement to below a certain height, useful for cave games.

Related Commands

If /spreadplayers is part of your toolkit, the commands below are the ones you will most often reach for alongside it: /tp, /teleport, and /worldborder. They cover closely related tasks, so the links above jump straight to each one.

Frequently Asked Questions about /spreadplayers

What does the /spreadplayers command do in Minecraft?

Distributes entities randomly across an area. Useful for minigames, random spawn placement, and similar applications. It belongs to the world command group and was added in Java Edition 1.6.

What is the correct syntax for /spreadplayers?

/spreadplayers

[under ] . The required arguments are center, spreadDistance, maxRange, respectTeams, and targets, and the optional one is maxHeight.

What permission level does /spreadplayers need?

It requires permission Level 2 - Game Master / Cheats. On a server the player must be an operator at that level, or have cheats enabled in single-player.

What is a common mistake when using /spreadplayers?

Setting spreadDistance larger than maxRange, makes it impossible to place all entities and the command fails.

Can you give an example of /spreadplayers in use?

Yes. /spreadplayers 0 0 5 50 true @a — spreads all players within 50 blocks of center, keeping teammates together.

Need a Minecraft server?

Try these commands on Astroworld or host your own server.

Try Astroworld Hosting