Text Syntax: Difference between revisions

From Citizens Wiki

No edit summary
No edit summary
Line 60: Line 60:


===Citizens Placeholders===
===Citizens Placeholders===
<br><code>%citizens_selected_npc_name%</code></br> -- the name of the NPC selected by the player.
<br><code>%citizens_selected_npc_name%</code> -- the name of the NPC selected by the player.
<br><code>%citizens_selected_npc_id%</code></br> -- the ID of the NPC selected by the player.
<br><code>%citizens_selected_npc_id%</code> -- the ID of the NPC selected by the player.


{{NavBox}}
{{NavBox}}
[[Category:Configuration]]
[[Category:Configuration]]

Revision as of 21:29, 24 August 2022

Configuration syntax in Citizens is simple. Nodes within arrow brackets -- <> -- will be parsed and replaced if possible. Below are the available nodes that you can use.

Chat Colors

Use the Chat Color characters the same as any other plugin. For example, &a would give you green.

Color Reference
0 -- BLACK
1 -- DARK BLUE
2 -- DARK GREEN
3 -- CYAN
4 -- DARK RED
5 -- PURPLE
6 -- GOLD
7 -- LIGHT GRAY
8 -- GRAY
9 -- BLUE
a -- GREEN
b -- AQUA
c -- ROSE RED
d -- LIGHT PURPLE
e -- YELLOW
f -- WHITE

Format Reference
k -- Obfuscated
l -- Bold
m -- Strikethrough
n -- Underline
o -- Italic
r -- Reset

Alternate color/format reference page

You can also use hexadecimal colors in Minecraft 1.16+, using Spigot's syntax - &x&f&f&0&0&e&e or Essentials' syntax - &#ff00ee (both examples produce the same pink/magenta color).

Other

There are also other nodes that you can use in configuration files. Some of these do not apply to certain configuration settings, so use with care. More will be added in the future as the need arises.

NPC Nodes

<npc> -- NPC's name
<id> -- NPC's ID
<owner> -- NPC's owner

Player Nodes


<player> -- Player's name
<world> -- Player's world
<nearest_player> -- Name of the player closest to the NPC

Extra Nodes


<random_player> -- Random online player name
<random_npc> -- Random NPC name
<random_npc_id> -- Random NPC ID

PlaceholderAPI

If you have PlaceholderAPI installed on your server, you can use PAPI placeholders on NPCs and use specific Citizens PAPI placeholders anywhere that supports PAPI.

External Placeholders on NPCs

You can use any PAPI Placeholders the same as you would use them elsewhere in NPC text or commands, and non-player placeholders in NPC names/holograms/etc. See the FAQ for more details on the non-player limit.

Citizens Placeholders


%citizens_selected_npc_name% -- the name of the NPC selected by the player.
%citizens_selected_npc_id% -- the ID of the NPC selected by the player.