-
Notifications
You must be signed in to change notification settings - Fork 332
How to display name from nickname plugins
- Type 1: Plugins that offer nickname placeholder
- Type 2: Plugins that change profile name
- Tips & Tricks
Example plugins: Essentials, CMI
This type of plugins only offer a nickname feature in form of a placeholder that can be displayed. They do not actually change player's name in game profile. Therefore, the only thing needed is to configure TAB to display the nickname placeholder.
To do so, configure customtabname and customtagname properties and use nickname placeholder from your nickname plugin. If you want to use this for all groups, you can use _DEFAULT_ group keyword, which applies that property to all groups that don't define it. Example:
groups.yml
_DEFAULT_:
customtabname: '%essentials_nickname%'
customtagname: '%essentials_nickname%'
Another way is to use commands (/tab group _DEFAULT_ customtabname %essentials_nickname%).
You only need to find correct PlaceholderAPI placeholder from your nickname plugin and use it.
Note: customtagname doesn't work by default. It is a property introduced by Unlimited nametag mode, which you need to enable to make it work. Even then, keep in mind that you cannot see your own armor stands by default, so you will still see your original name, just others won't.
WARNING: Do NOT put nickname placeholder into tabprefix/tagprefix! You will end up with double names!
Example plugins: ???
These plugins actually change name in game profile, which also changes it in nametag. However, it breaks all name-bound features, especially nametags and sorting. For that reason, TAB must detect name change. This is done automatically on Bukkit, BungeeCord and Fabric. This detection is not available on Sponge and Velocity (but may get added if requested).
In order for TAB to properly detect name change, player UUID must remain the same, otherwise it's a random entry with a random uuid and random name, which TAB isn't able to match with actual players. Make sure your nickname plugin is not changing UUID of players.
Identifying whether this feature it working properly or not can be checked by setting debug: true in config and checking console on name change. It should say Processing name change of player <player name> to <new nickname>. If it doesn't, something went wrong, most likely UUID not matching.
Just like with the first type of plugins, if you want to display the nickname in tablist, you'll need to get placeholder from the nickname plugin and put it into customtabname. You no longer need to mess with customtagname, as the nickname plugin handles that already.
By default, Essentials prefixes nicknames of players in chat using ~ symbol for nicked players. We can very easily replicate that with Conditional placeholders. First, 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 instead of the placeholder directly.
Let's say your sorting list looks like this:
sorting-types:
- "GROUPS:owner,admin,mod,helper,builder,vip,default"
- "PLACEHOLDER_A_TO_Z:%player%"
Let's also assume that you want every nicked player to be sorted as default. This can be achieved using sorting by placeholder and creating a condition that will return output based on nick status. First, let's create the condition:
conditions:
group:
conditions:
- '%haonick_isNicked%=true'
yes: "default"
no: "%group%"
When the condition is met, meaning player is nicked, it will return the group we want nicked players to be sorted as, in this case default. Otherwise, return player's actual group.
The condition check may differ with different nickname plugins. You will need to check documentation of your nickname plugin to see what kind of placeholders it offers and what they return (you can also use /tab parse to see what exactly did a placeholder return).
In this case, we are using placeholder %haonick_isNicked%, which returns true for nicked players.
If using Essentials, the line would look like this: %essentials_nickname%!=%player%, because Essentials is made to return player's actual name when not nicked, meaning when it's not equal, player is nicked.
Finally, use the conoditional placeholder in sorting:
sorting-types:
- PLACEHOLDER:%condition:group%:owner,admin,mod,helper,builder,vip,default"
- PLACEHOLDER_A_TO_Z:%player%
This will result in nicked players being sorted as default.
If you want to achieve something more complicated, such as not only sorted as default, but another rank, you will need to dig deeper into your problem, analyzing available placeholders and functions that will help you achieve your result.
- Why TAB?
- Installation
- Commands & Permissions
- Frequently Asked Questions
- Compatibility
- How to assign players into groups
- Known issues
- TAB-Bridge plugin
- Belowname
- Bossbar
- Global playerlist
- Header/Footer
- Layout
- Multi server support
- Nametags
- Per world playerlist
- Ping spoof
- Playerlist objective
- Scoreboard
- Sorting in tablist
- Spectator fix
- Tablist name formatting