Introduction

Selectors

How to use selectors to target specific players in OpenAudioMc.

A player selector is a filter that tells OpenAudioMc who should receive a command. Use selectors to target a single player, a group of players, or every player on the server. Selectors follow Minecraft selector syntax and accept additional filters in square brackets.

Select a player by name

To target a specific player use their exact in game name. Names are case sensitive.

Command<> required[] optional

/openaudiomc play John

Select everyone

To target every player on the server use the all players selector.

Command<> required[] optional

/openaudiomc play @a

Select players by WorldGuard region

This requires WorldGuard to be installed. In some setups that use a proxy such as BungeeCord or Velocity the region selector may not function when run manually from chat. If you run into issues try executing the command from a command block.

Example targeting the region named myregion:

Command<> required[] optional

/openaudiomc play @a[region=myregion]

Select players by server

This selector is available when OpenAudioMc runs on a proxy such as BungeeCord or Velocity. It only works when issued from the chat or the proxy console.

Example targeting players on the server named lobby:

Command<> required[] optional

/openaudiomc play @a[server=lobby]

Select players by radius

Use the radius filter to target players near a point. The radius is measured in blocks.

Example targeting players within 100 blocks of the command origin:

Command<> required[] optional

/openaudiomc play @a[r=100]

Change the origin location

By default the origin for radius calculations is the player or command block that ran the command. Override the origin by adding x, y and z coordinates to the selector. Chain the coordinates with the radius to target players around that location.

Example targeting players within 100 blocks of coordinates 100, 100, 100:

Command<> required[] optional

/openaudiomc play @a[r=100,x=100,y=100,z=100]

Tips and notes

  • Selectors accept multiple filters combined inside the same brackets. For example you can combine region and radius filters where supported.
  • When using region selectors verify WorldGuard is loaded and that the region name is correct.
  • When using server selectors make sure you run the command from a proxy aware context such as proxy chat or the proxy console.
  • If a selector does not behave as expected test it in a command block to rule out chat parsing differences.