Skip to content

Mini guides collection

Tanguy edited this page Dec 12, 2021 · 68 revisions

Content

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

Displaying death counter in tablist

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

Make sure you have PlaceholderAPI installed with statistic expansion (/papi ecloud download statistic).
Note: This is taken from server stats. You can modify / reset this 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 %luckperms-prefix% (and suffix) 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.

Adding nickname prefix

Create a new condition:

conditions:
  nick:
    conditions:
    - '%essentials_nickname%=%player%'
    yes: "%player%"              # If nickname = player name -> player is not nicked
    no: "~%essentials_nickname%" # If nickname != player name -> player is nicked

Then use %condition:nick% in your customtabname & customtagname.
If you want another nickname prefix than ~, change it in the no: part of the condition

Clone this wiki locally