Nametag Formats
How to customize both global and individual player nametag formats.
Global vs. individual formats
There are two types of nametag formats in CustomPlayerNametags:
- Global — A universal format that is applied to all players by default. It can be set by either changing the
nametag-formatin config.yml, or by using the command. - Individual — A format that is specific to a single player. It can only be set by using the command.
An individual format will always override the global format for that player.
Placeholders
Any PlaceholderAPI placeholder can be used in a nametag format string. A couple of common examples:
%player_name% the player's username\n%luckperms_prefix% the player's LuckPerms prefix\n%essentials_nickname% the player's Essentials nicknameSee the PlaceholderAPI placeholder guide for in-depth info on using them. Without PlaceholderAPI installed, placeholders are left as literal text rather than being resolved.
CustomPlayerNametags placeholders
CustomPlayerNametags also registers its own PlaceholderAPI expansion placeholders, allowing other plugins that support PlaceholderAPI to utilize the same format without needing to duplicate it.
| Placeholder | Returns |
|---|---|
%customplayernametags_format% | The format currently in effect for the requesting player — their individual nametag if one exists, otherwise the global nametag-format from config.yml. |
%customplayernametags_format_global% | The global nametag-format from config.yml. |
One use case for these placeholders is with another AFXPlugins plugin, CustomAdvancementMessages. By using one of these placeholders in the CustomAdvancementMessages player-name-format config option, you can reuse the same format across both plugins without needing to duplicate it.
Multiple lines
Put \n anywhere in a format to start a new line:
%luckperms_prefix%&e%essentials_nickname%\n&6(&b%player_name%&6)
This works with both global and individual nametag formats, and there is no limit to the number of lines you can create.
Color and style codes
Key for all Minecraft '&' color and style codes:
| Code | Color |
|---|---|
&0 | black |
&1 | dark blue |
&2 | dark green |
&3 | dark aqua |
&4 | dark red |
&5 | dark purple |
&6 | gold |
&7 | gray |
&8 | dark gray |
&9 | blue |
&a | green |
&b | aqua |
&c | red |
&d | light purple |
&e | yellow |
&f | white |
| Code | Style |
|---|---|
&l | bold |
&o | italic |
&n | underline |
&m | |
&r | reset color and styles |
How often it refreshes
Nametags automatically refresh once per second for every online player, so placeholders that change over time stay up to date without needing a manual reload.
CustomPlayerNametags