Skip to content
MC Command Generator

Target Selector Generator

Beta

Pick who you want to target, add filters like mob type, radius, tags or scores, and watch a top-down radar show who the selector catches. The result comes wrapped in a test command you can paste straight into chat.

Describe it — AI writes the command

Type what you want in plain words. The AI fills the form below, so you can see it and change anything. It follows the edition and version you picked.

Checking the AI…

Paste a command— edit it here or move it to another version
Who
Filters
Distance and areadistance
How many and which first
Playersgame mode, level, scores
Looking directiondegrees
AdvancedJava
NSAlexSteveKaiNoor123
say @e[type=zombie,distance=..20,sort=nearest,limit=3]
  • Player
  • Zombie3
  • Skeleton
  • Creeper
  • Cow
  • Pig
  • Villager

5 players and a few mobs stand in for your world.

Top-down view, you in the middle. 3 of 23 picked.

Your command · Java 26.3

55 characters
/say @e[type=zombie,distance=..20,sort=nearest,limit=3]

Raw editor

How it works

A selector is the @e[…] part of a command. The same idea is written differently depending on your edition and version, so the generator writes the right form for the version you pick. “The five nearest zombies within 10 blocks” looks like this:

Java 1.13 and later (26.x too)

@e[type=zombie,distance=..10,sort=nearest,limit=5]

Ranges use two dots: distance=..10 is up to 10 blocks, distance=5.. is 5 or more, level=10..20 is between. Arguments like tag and type=! can repeat. predicate needs 1.15, and @n (nearest entity) needs 1.21 — on older versions the generator writes @e[sort=nearest,limit=1] instead.

Java 1.11 and 1.12

@e[type=zombie,r=10,c=5]

Before 1.13, radius was r/rm, count was c (negative counts the furthest first), game mode was a number (m=1 for creative) and scores were score_kills_min=1. Only one tag fits in a selector. Versions before 1.11 used mob names like Zombie and are not written.

Bedrock

@e[type=zombie,r=10,c=5]
@a[m=survival,tag=red_team,hasitem={item=diamond}]

Bedrock keeps the short names (r, c, m, l, rx) and adds family, hasitem and @initiator for NPC buttons. It has no teams, NBT or predicates. @n arrived in Bedrock 1.21.100.

Testing a selector

“Try it with” puts the selector in a command: say lists who it found in chat, Glowing outlines them for 10 seconds (Java), tp brings them to you and kill removes them. Every other generator here, like /tp and /effect, also has a Build button next to its target field for quick selectors.

FAQ

What is the difference between @p, @a, @r, @e, @s and @n?

@p is the nearest player, @a every player, @r a random player, @e every entity (mobs, items, players), @s whoever runs the command and @n the nearest entity of any kind (Java 1.21+, Bedrock 1.21.100+).

How do I select mobs within a radius?

On Java 1.13+ add distance=..10 for 10 blocks, on Bedrock and Java 1.12 or older add r=10. For a ring, set a minimum too: distance=5..10 or rm=5,r=10.

How do I target only one entity?

Use limit=1 on Java (with sort=nearest for the closest) or c=1 on Bedrock. @p and @n already pick one.

Why does type= give an error with @a or @p?

@a, @p and @r only select players on Java, so a mob type makes no sense there. Use @e or @n to pick mobs by type.

How do I select every mob except players?

Add type=!player. On Java you can stack exclusions, for example @e[type=!player,type=!item].