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.
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
- Check who it catches
/say @elists the matching targets in chat. Check the selection before running/kill. - Place at the target location
The selector goes where the username appears in the command
/tp,/effect,/give. - 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 @eremoves dropped items and item frames, and kills the player too.- Ranges are written with dots.
..10— not further than ten2..— not closer than two2..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=!creeperis valid, but two positivetype=The game rejects: an entity cannot have two types at once. - For
@pand@rare already setlimit=1and order. Adding them is not an error, but not work either. However,@s[limit=1]the game rejects the command entirely —@salready selects one target. dx,dy,dz— not radius These are the box's dimensions, extending in the positive direction from its origin. Combined withdistanceboth conditions must match: the target must be inside both the sphere and the box.@aincludes dead players and spectators. For all living players, you needgamemode=!spectator, and sometimes health checks via NBT.- Player-based commands will not accept selectors targeting mobs.
/gamemode,/give,/clearand/xprejected@eentirely — 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.
