Minecraft target selector builder

Commands

Understand @a, @p, @e, @s and their argumentsLearn more

The part you need @e[type=zombie,distance=..10], used inside many commands. A selector that matches nothing may leave a command with no visible effect.

My Game select version

Save your preferences in this browser and apply them to supported tools. Settings in a shared link take priority. Wiki version labels are not affected.

Where does it begin

Any entities — including items, arrows, and frames.

Who to look for

Without it, @e will take everything: items, arrows, frames.

Player's username or mob's name above their head.

Marker set by /tag. It has no in-game significance.

From the origin point. '..10' means no more than ten blocks away.

The origin point. By default, this is where the command runs.

Not a radius, but the box size from the origin point in the positive direction.

-90 — straight up, 90 — straight down

Values from /scoreboard.

Check the entity's full data

From a data pack.

Where to place

Result

Selector and command

/kill @e

Selector

@e

The full command

8 of 256
/kill @e
  • Without a type filter, @e includes dropped items, arrows, item frames, paintings, boats, and minecarts. Using it with /kill can remove those entities along with mobs.

What does each selector mean?

Selector Who is selected How many targets already enabled
@e Any entities — including items, arrows, and frames. all matching targets —
@a All players, including spectators and dead ones. all matching targets —
@p Nearest player. one limit=1, sort=nearest
@r Random player one limit=1, sort=random
@s Selects the command executor directly, without searching for a target. one —
@n Nearest entity. Introduced in 1.21. one limit=1, sort=nearest

Arguments are written in square brackets immediately after the selector and separated by commas: @a[gamemode=survival,distance=..20]. A exclamation mark before a value means 'except': type=!player.

How to use the result

  1. Check who it catches

    /say @e lists the matching targets in chat. Check the selection before running /kill.

  2. Place at the target location

    The selector goes where the username appears in the command /tp, /effect, /give.

  3. Long one — in a command block

    Chat has a 256-character limit. Command blocks have no such limit, and selectors are counted from the block, not from you.

What to know about selectors

  • @e — that's all Dropped items, arrows, experience orbs, frames, paintings, boats, and minecarts are also entities. This is the most well-known problem: /kill @e removes dropped items and item frames, and kills the player too.
  • Ranges are written with dots. ..10 — not further than ten 2.. — not closer than two 2..10 — between. A number means exactly that amount, and by distance it almost never works
  • You can have multiple negations, but only one affirmation. type=!zombie,type=!creeper is valid, but two positive type= The game rejects: an entity cannot have two types at once.
  • For @p and @r are already set limit=1 and order. Adding them is not an error, but not work either. However, @s[limit=1] the game rejects the command entirely — @s already selects one target.
  • dx, dy, dz — not radius These are the box's dimensions, extending in the positive direction from its origin. Combined with distance both conditions must match: the target must be inside both the sphere and the box.
  • @a includes dead players and spectators. For all living players, you need gamemode=!spectator, and sometimes health checks via NBT.
  • Player-based commands will not accept selectors targeting mobs. /gamemode, /give, /clear and /xp rejected @e entirely — even if only players actually hit it
  • The order of arguments is irrelevant to the game. The generator uses a consistent argument order so the same selector has one stable representation and shareable URL.

Selector — half of the command. The other half is with neighbors: mob generator creates the mob you will later select, while /tellraw generator — the message they receive

Frequently asked questions

How does @p differ from @s in Minecraft?

@p — the nearest player to the command's execution point; @s — the player executing the command. In a command block, @s refers to no one.

How to select mobs in a radius?

Distance argument with range through two points: distance=..10 — no further than ten blocks. The entity type is required at this time, otherwise @e will catch items, arrows, and frames.

Why can't the selector find anyone?

Check the entity type for typos and ensure the arguments are valid for the selected target. For example, @s does not accept limit=1.