Target selector generator

A target selector chooses the entities a command will affect. The basic selectors of the Minecraft Wiki are @a (all online players), @e (all entities in loaded blocks), @p (the nearest player), @r (a random player) and @s (whoever runs the command).

The arguments filter the result: position, distance, type, tag, name, game mode, level, limit and sorting. This tool checks the type and range of each argument according to the wiki's table. For example, distance accepts only zero or positive values.

Sorting and limit are features of Java Edition. The wiki gives no minimum for the limit; here we accept whole numbers of 1 or more.

Tool

Position (x, y, z)
Search area (dx, dy, dz)

@e

How to use

  1. Choose the base selector.
  2. Fill in only the arguments you need. Empty fields do not go into the selector.
  3. Use ranges such as 5..10 (minimum and maximum), ..10 (up to 10) or 5.. (from 5) when the argument accepts ranges.
  4. Copy the selector and use it in place of the target in a command.

Frequently asked questions

What does the ! before a value mean?

It inverts the filter. For example, type=!zombie selects entities that are not zombies. The wiki describes this use for type, tag, name and gamemode.

Why does distance not accept negative numbers?

Because the wiki says that, in distance, only unsigned values are allowed.

What is limit for?

It limits how many entities the selector returns. Together with sort, it chooses which ones are included: the nearest, the furthest or at random.

Do names with spaces work?

Yes. The tool puts the name in quotation marks, as the wiki requires. Quotation marks inside the name are not accepted.

Sources