AFXPlugins AFXPlugins / CustomPlayerNametags logo CustomPlayerNametags v1.0.0
Guide

Nametag Formats

How to customize both global and individual player nametag formats.

Preview of a custom player nametag.

Global vs. individual formats

There are two types of nametag formats in CustomPlayerNametags:

  1. Global — A universal format that is applied to all players by default. It can be set by either changing the nametag-format in config.yml, or by using the command.
  2. Individual — A format that is specific to a single player. It can only be set by using the command.
Format Priority

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 nickname

See 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.

PlaceholderReturns
%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.
Example Plugin Integration

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)
Preview of multi-line nametag format.
Example output from format listed above.

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:

CodeColor
&0black
&1dark blue
&2dark green
&3dark aqua
&4dark red
&5dark purple
&6gold
&7gray
&8dark gray
&9blue
&agreen
&baqua
&cred
&dlight purple
&eyellow
&fwhite
CodeStyle
&lbold
&oitalic
&nunderline
&mstrikethrough
&rreset 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.