Target Selector Builder

Distance and count
Name and tags
Origin
Scores

Worked examples

1. All players within 10 blocks

Target an area reward or message, measured from the command origin

@a[distance=..10]

Selected targets Matching players, distance at most 10 blocks

2. Nearest zombie without the protected tag

Select one zombie for an entity command while excluding tagged entities

@e[type=minecraft:zombie,tag=!protected,limit=1,sort=nearest]

Selected targets Matching entities, type minecraft:zombie, without tag protected, select at most 1, nearest first

3. Bedrock players with at least 10 points

Select players who reach a score threshold; the points objective must already exist

@a[scores={points=10..}]

Selected targets Matching players, score points = 10..

Syntax by edition and version

This is the first example above, run through every edition and version this tool supports. Versions that produce the same result share a row

Java Edition 1.21.5 and up Java Edition 1.20.5 - 1.21.4 Java Edition 1.13 - 1.20.4 (legacy NBT)
@a[distance=..10]
Bedrock Edition (stable)
@a[r=10]