Skip to content

Mini guides collection

NEZNAMY edited this page Oct 31, 2022 · 68 revisions

Content

Combine the knowledge gathered by reading the wiki to get interesting results, most frequently asked ones listed here.

Displaying kill / death counter in tablist

Kills:

yellow-number-in-tablist: 
  enabled: true
  value: "%statistic_player_kills%"

Deaths:

yellow-number-in-tablist: 
  enabled: true
  value: "%statistic_deaths%"

Make sure you have PlaceholderAPI installed with statistic expansion downloaded (/papi ecloud download statistic & /papi reload).
Note: These values are taken from server stats. You can modify / reset them for each player in <main world>/stats/<player uuid>.json file.

Taking prefixes/suffixes from permission plugin

Delete all groups from groups.yml and only keep this:

_DEFAULT_:
  tabprefix: "%vault-prefix%"
  tagprefix: "%vault-prefix%"    
  tabsuffix: "%vault-suffix%"    
  tagsuffix: "%vault-suffix%"

This requires Vault and a permission plugin to work.
If you have luckperms installed on the same server instance, you can use TAB's internal %luckperms-prefix% (and suffix) placeholders instead.
Note: If TAB is on bungeecord and you want prefixes to be taken from backend servers, use %vault_prefix% (or %luckperms_prefix%) with PlaceholderAPI support on bungeecord.

Showing player version in tablist

Run /tab group _DEFAULT_ tabsuffix " &8[&3%player-version%&8]" or any other color combination you want.
If you want it aligned on the right, enable Aligned tabsuffix.

Replicating Purpur's TPSBar

By default, Purpur's TPSBar shows server's TPS, MSPT and player ping. These change color from green to red based on value. The easier way to achieve this is with Placeholder output replacements, however, it alters placeholders everywhere inside TAB, which would result in features like Yellow number to stop working correctly when %ping% is used, since it would contain color codes now. For that reason, we will use Conditions instead.

When TPS is above 19, it displays as <#55FF55>value</#00AA00>. When above 15, <#FFFF55>value</#FFAA00>, otherwise <#FF5555>value</#AA0000>. This can be achieved with 2 conditions:

conditions:
  tps:
    conditions:
      - "%tps%>=19"
    yes: "<#55FF55>%tps%</#00AA00>"
    no: "%condition:tps2%"
  tps2:
    conditions:
      - "%tps%>=15"
    yes: "<#FFFF55>%tps%</#FFAA00>"
    no: "<#FF5555>%tps%</#AA0000>"

To use this, we will use %condition:tps%.
Now, repeat for mspt and ping. For mspt, purpur's intervals are <40, <50, 50+. For ping, it's <100, <200, 200+.

Conditions for mspt and ping may look something like this:

conditions:
  mspt:
    conditions:
      - "%mspt%<40"
    yes: "<#55FF55>%mspt%</#00AA00>"
    no: "%condition:mspt2%"
  mspt2:
    conditions:
      - "%mspt%<50"
    yes: "<#FFFF55>%mspt%</#FFAA00>"
    no: "<#FF5555>%mspt%</#AA0000>"
  ping:
    conditions:
      - "%ping%<100"
    yes: "<#55FF55>%ping%</#00AA00>"
    no: "%condition:ping2%"
  ping2:
    conditions:
      - "%ping%<200"
    yes: "<#FFFF55>%ping%</#FFAA00>"
    no: "<#FF5555>%ping%</#AA0000>"

To use them, we will use %condition:mspt% and %condition:ping. Purpur's TPSBar is using mspt as bossbar progress with range from 0 to 50. This can be achieved with PlaceholderAPI's math expansion: %math_0_{tab_placeholder_mspt}*2%. It always uses GREEN color and NOTCHED_20 style. Let's put all of this together in bossbar.yml:

  bars:
    tpsbar:
      style: NOTCHED_20
      color: GREEN
      progress: "%math_0_{tab_placeholder_mspt}*2%"
      text: "&7TPS&e: %condition:tps% &7MSPT&e: %condition:mspt% &7Ping&e: %condition:ping%&7ms"

The last step is to configure when should this bossbar be displayed. One way is to use bossbar announce/send command. Another is to use display conditions. An example can look like display-condition: "%permission:tab.tpsbar%. Now, only players with the permission will see the bossbar.

BedWars1058 compatibility

Sorting

To sort teams through TAB, add the PLACEHOLDER_A_TO_Z sorting type with the %bw1058_player_team% placeholder. Example:

sorting-types:
  - "PLACEHOLDER_A_TO_Z:%bw1058_player_team%"
  - "GROUPS:admin,mod,default"
  - "PLACEHOLDER_A_TO_Z:%player%"

Team name in tablist/nametag

To display the team name in the tablist, use this command: /tab group _DEFAULT_ tabprefix %bw1058_player_team%
The same goes for the nametag, but with tagprefix instead: /tab group _DEFAULT_ tagprefix %bw1058_player_team%

To display only the first letter of the team, download this PlaceholderAPI expansion: https://api.extendedclip.com/expansions/bw1058plus/ and use %bw1058plus_team_letter% instead, if you want the color as well, put %bw1058plus_team_color% right before.

Rank in lobby & Team name in game

If you want to display the rank of the player while he's in the lobby or waiting lobby, BUT show the team name while in game, then don't worry, there's a way =)
You can create a condition which checks if the player's current team = nothing (which means the player isn't playing), and return either the rank or the team name depending on that condition. Example:

conditions:
  rankOrTeam:
    conditions:
      - "%bw1058_player_team%="
    yes: "%luckperms-prefix%"
    no: "%bw1058_player_team%"

And then do /tab group _DEFAULT_ tabprefix %condition:rankOrTeam% and /tab group _DEFAULT_ tagprefix %condition:rankOrTeam% so it shows in your nametag and in your tablist name.

Clone this wiki locally