Target Selector Generator
Build @a @e @p @s @r target selectors visually: entity type, distance, coordinate range, scores, tags, teams, sorting, and count, with easy-to-read explanations for every argument.
Loading game data…
Target selectors:@p the nearest player,@a all players,@r a random player,@e all entities,@s the executor,@n the nearest entity (since 1.21). Add conditions in square brackets; for example, @e[type=zombie,distance=..10] targets Zombies within 10 blocks.
Frequently Asked Questions
How do I select the nearest mob?
Since 1.21, use @n; earlier versions use @e[sort=nearest,limit=1]。
How do I select entities within a certain range?
distance=..10 means within 10 blocks,distance=5.. means more than 5 blocks away; you can also use x,y,z with dx,dy,dz to select a cuboid region.