NationCrest

Placeholders

The five PlaceholderAPI placeholders NationCrest exposes and how to use them.

This is the part most servers want. The placeholders let the country go into whatever tab list, scoreboard, chat or nametag plugin you already run, instead of that plugin and this one fighting over the same output.

Setup

Install PlaceholderAPI. That is it. NationCrest registers its own expansion on start, there is nothing to download inside PlaceholderAPI.

Check it worked:

/papi list

nationcrest should be in the list. If it is not, check your log for the line saying the expansion registered.

Without PlaceholderAPI the plugin runs normally, you simply do not get placeholders.

The placeholders

PlaceholderReturnsExample
%nationcrest_code%The two letter country codeUS
%nationcrest_name%The full country nameUnited States
%nationcrest_flag%The display value for the current mode, unformattedUS
%nationcrest_display%The display value with the format and colours applied&7[&fUS&7]
%nationcrest_toggled%Whether the player has their flag shownShown

Which one to use

%nationcrest_display% for almost everything. It is the flag with display.format and the country's colour already applied, so it drops straight into a tab list format.

%nationcrest_flag% when you want to do the wrapping and colouring yourself in the other plugin.

%nationcrest_code% and %nationcrest_name% when you want the raw values, for a scoreboard line or a join message.

%nationcrest_toggled% for a settings menu, so a player can see the state before flipping it. The two words it returns come from the language file.

Fallbacks

Every placeholder returns the display.fallback string rather than nothing when the country is unknown or the player has hidden their flag. It is never null and never an empty string, so a tab list format never collapses into a gap.

Change it in config.yml:

display:
  fallback: '&7??'

%nationcrest_toggled% is the exception. It reports the real toggle state even for a player who has hidden their flag, because that is the whole point of it.

Offline players

The country is stored against the account rather than only kept while the player is connected, so the placeholders still resolve for a player who is offline, wherever the plugin asking for them passes an offline player.

Examples

A tab list plugin's player format

%nationcrest_display% %player_name%

A scoreboard line

&7Country: &f%nationcrest_name%

A nametag prefix

%nationcrest_display%

A join message

&7%player_name% joined from &f%nationcrest_name%

Testing them

/papi parse me %nationcrest_code%
/papi parse me %nationcrest_display%

/papi parse me needs to be run by a player, not from the console.

On this page