How Minecraft target selectors work
A target selector is an argument, not a command by itself. It starts with a base such as @p for the nearest player or @e for entities, followed by optional filters inside square brackets. Paste the finished selector wherever a compatible command expects a player or entity target.
Java and Bedrock share the familiar @p, @a, @r, @s, and @e bases, but their filter names are not interchangeable. This generator changes the parameter names and available controls when you switch editions, so it does not produce Java distance or sort arguments inside a Bedrock command.
Choose the correct base
@p finds the nearest player, @a all players, @r a random player, @s the command executor, and @e all entities. Java also has @n for the nearest entity, while Bedrock has @initiator for the player who opened NPC dialogue.
Combine precise filters
Narrow results by entity type, name, tag, game mode, distance, experience level, coordinates, a cuboid volume, facing rotation, scoreboard values, and edition-specific advanced data.
Control the result set
Java uses limit with sort=nearest, furthest, random, or arbitrary. Bedrock uses c to cap the number of targets selected according to the base selector ordering.
Keep technical values unchanged
Selector keys, entity IDs, objective names, tags, namespaces, and command tokens are game data. Enter them exactly as they exist in your world, datapack, behavior pack, or scoreboard.
Target Selector Questions
Can a target selector run on its own?
No. A selector identifies targets for another command. For example, /kill @e[type=minecraft:zombie,distance=..10] removes nearby zombies in Java Edition.
Why does Bedrock use r while Java uses distance?
The editions define different selector argument names. Java expresses a distance range with distance=minimum..maximum. Bedrock uses rm for the minimum radius and r for the maximum radius.
What is the difference between @p and @n?
@p selects the nearest player. Java @n selects the nearest entity of any eligible type, so it can return a mob, item, or player unless additional filters narrow the result.
How do exclusions work?
An exclamation mark negates supported identity filters. For example, type=!minecraft:player excludes players and tag=!safe excludes entities carrying the safe tag.
Should selector keywords be translated?
No. Tokens such as @e, type, distance, family, scores, and entity IDs are literal Minecraft syntax. Only the interface explanations should be localized.