Minecraft – What do you call the thing that is in between the square brackets in a Minecraft comand

minecraft-commandsminecraft-java-editionterminology

I want to know what it is called and I would like a list of things (or a link to a list of things) you can do with it.
I only know @p[score_name_min=1].

I want to know if there is something like: @p[activingeffect???].

I'm building something that will only affect the player if he has no active effect, e.g. give speed when the player does not have a speed effect yet.

I would like to use only 1 command:

/effect @p[No speed effect] 1 1.

Best Answer

That thing is called target selector argument.

As of Mineraft 1.8.9, there are 20 different arguments available for use:

x, y, z         coordinates
r, rm           radius (max, min)
m               game mode
c               count
l, lm           experience level (max, min)
score_name      max score
score_name_min  min score
team            team name
name            entity name
dx, dy, dz      volume dimensions
rx, rxm         vertical rotation (max, min)
ry, rym         horizontal rotation (max, min)
type            entity type

The 1.9 snapshot 15w32b added another argument.

tag             scoreboard tag

As you can see, there is no way to check for active effects using target selector arguments. Checking for an entity's active effects can only be done by looking at it's data tag, e.g. checking if it matches {ActiveEffects:[{Id:1b}]}. The /effect command is not able to do that by itself, which means that you won't be able to do what you describe in a single command.

Using scoreboards, you can "translate" data tag matching into a score or a tag (1.9 only), which you can then use with target selector arguments.

Create a dummy objective to store the score:

/scoreboard objectives add hasSpeed dummy

Create a 20Hz. clock (setblock/fill clock, in 1.9, use repeat/chain command blocks) and run the following commands:

/scoreboard players set @a hasSpeed 0
/scoreboard players set @a hasSpeed 1 {ActiveEffects:[{Id:1b}]}

Afterwards, you can run

/effect @a[score_hasSpeed=0] 1 1

on the same clock.