Vanilla Selectors

A few vanilla selectors and tags supported in GooP to target players.

I had to re-code them so they may not work exactly like vanilla selectors. They work when using Command Blocks too!

You may actually specify any number of player names and selectors as a colon-separated list.

Basic Sintax

There are four basic selectors:

  1. @p - Targets the nearest players to the sender of the command. Does not work from the console. Must be in same world.

  2. @a - Targets every player in the server.

  3. @r - Targets a random player in the server.

  4. @s - Targets the players who had a 'success' in the previous chained GooP command.


Selector Parameters

Allow for filtering of who gets selected. They are specified as a comma-separated list inside square brackets after the selector:

  • @a[distance=..10] will select every player in the server within 10 blocks of you.

  • None of these work with @s


Distance

Written in the format distance=[min]..[max], will exclude from the equation all players not within this range.

  • Both minimum and maximum are optional, the default minimum distance is 0, and the default maximum is infinity.

  • Supports decimal point values

  • Ignored if called from the console

  • Negative values are theoretically allowed but they just dont make sense.

  • Range limits are inclusive.

  • Players must be in the same world as you


Game Mode

Writen in the format gamemode=[Gamemode], will exclude from the equation those players not in this gamemode.

  • Possible gamemodes are: CREATIVE, SURVIVAL, ADVENTURE, SPECTATOR.


Scoreboard Tag

Written in the format tag={[TAG1],[TAG2],[...]}, will exclude those players who dont have every single one of these tags.

  • If you are only specifying one tag, you may omit the curly brackets. But if you are specifying more than one, they are required.

  • You may specify any number of comma-separated tags.


Score

Surely enough GooP had to support scoreboards, since its what it communicates with.

Written in the format scores={[objective]=[MIN]..[MAX],[objective2]=[MIN]..[MAX],[...]}, will exclude every player outside these score ranges. Basically, a player must be within the specified range in every score to qualify.

  • You must always use the curly brackets, even when specifying only one score.

  • Negative values are allowed, but scores can never have a decimal points, they are always integer.

    • You may still use decimal values in this operation though.

  • Range limits are inclusive.


Limit

Specify the maximum number of players found by each selector using the sintax limit=[X]. Changes the behaviour of @p drastically, and is completely ignored by @a (doesnt make sense, use @r instead).

It runs after the other selectors have filtered out the players that do not match them.

  1. Behaviour with @p:

    • If the value is positive, it selects this many in the order they are closest to you.

    • If the value is negative, it selects this many in the order they are furthest from you.

    • Actually, this selector works by default with limit=1

  2. Behaviour with @a:

    • It is ignored

  3. Behaviour with @r:

    • Selects up to this many players randomly from those online (that qualify all the other selector parameters listed above).

    • Actually, this selector works by default with limit=1

Simple Examples:

@a[scores={BurgersEaten=3..5}]

Will target those online players with a score 'BurgersEaten' from three to five, inclusive.


@p[limit=-3]

Will target the three furthest players from you in the same world you are on.


@r[limit=2,distance=5..100,tag={sugra,something}]

From all those players five to a hundred blocks away from you, that have both tags sugra and something, it will pick out two at random.


@a[gamemode=CREATIVE]

Targets everyone in creative mode.

Pro Tip

Because of CustomStructures supporting location-dependent selectors like @p, you may also use them through the console via an obscure way:


Instead of calling a goop command as /goop [subcommand], use /goop <w,x,y,z>[subcommand], where:

  • w is the name of the world where the selectors will work

  • x is the x position relative to which the selectors will work

  • y is the y position relative to which the selectors will work

  • z is the z position relative to which the selectors will work

Ex /goop <world_the_end,0,64,0>grief @p bl 10


This doesnt work if you use spaces in your world names. If you do, let me tell you that that practice is disgusting.