Player Sets - CodeCrafter47/AdvancedTabOverlay GitHub Wiki

A player set is a named subset of your players. The plugin uses player sets to display players and player counts in the tab list. Whenever you want to display a player count, or display players on the tab list the first step is to create a player set containing these players. In the following we will have a look at how to create player sets, and you will see various examples for useful player sets.

Content

Creating Player Sets

You can create a player set by editing the playerSets section in the tab list configuration file. A simple player set containing all players can be created like this:

playerSets:
  all_players: all

The above line creates a playerSet called all_players that contains all players.

Now you could use that player set to display the number of players on your server in the footer of the tab list:

footer: "&7Total players:&f ${playerset:all_players size}"

As you can see from the example the ${playerset:all_players size} placeholder is used to display the number of players in the player set. This works the same for all player sets: The ${playerset:<name> size} placeholders displays the number of players in a particular player set.

Player on a Specific World

Let's create a player set that only contains players on a specific world. For this example it is assumed that there is a world called lobby.

playerSets:
  all_players: all
  lobby: ${player world} == "lobby"

Now that isn't too difficult. Let's create a player set for a survival world, that also contains players on the survival_nether and survival_the_end worlds:

playerSets:
  all_players: all
  lobby: ${player world} == "lobby"
  survival: ${player world} == "survival" or ${player world} == "survival_nether" or ${player world} == "survival_the_end"

That long line does not look very nice, we can split it across three lines to increase readability:

playerSets:
  all_players: all
  lobby: ${player world} == "lobby"
  survival: |
    ${player world} == "survival" or 
    ${player world} == "survival_nether" or 
    ${player world} == "survival_the_end"

Now a word on using Placeholders when creating a player set. You usually want to use player variant of the placeholder when creating a condition that a player must fulfill to be part of the player set.

Selecting Players by Group

Last but not least we create a player set that contains all admins. For this example all players in either that admin or owner permission group are considered admins:

playerSets:
  # ...
  admins: ${player vault_primary_group} == "admin" or ${player vault_primary_group} == "owner"

To increase readability the complex definitions can be split up over multiple lines:

playerSets:
  # ...
  admins: |
      ${player vault_primary_group} == "admin"
      or ${player vault_primary_group} == "owner"

You could create a player set that contains all non-admins the same way, by listing all the groups, however a better way is to create a filter that says "everyone except admins" by replacing == with != and or with and.

playerSets:
  # ...
  admins: |
      ${player vault_primary_group} == "admin"
      or ${player vault_primary_group} == "owner"
  non_admins: |
      ${player vault_primary_group} != "admin"
      and ${player vault_primary_group} != "owner"

Selecting Players by Permission

An alternative to identifying admins by their group is to give them a specific permission. For the purpose of this example we assume that all staff member have the tablist.staff permission. Then we can create a player set containing all staff members, and a player set containing all player which are not staff by querying that permission:

playerSets:
  # ...
  staff: ${player permission tablist.staff} = true
  non_staff: ${player permission tablist.staff} = false

Next: Header and Footer

⚠️ **GitHub.com Fallback** ⚠️