đĸ Global Variables
Quick Startâ
A global variable is a reusable text snippet you define once and reference anywhere â item names, lore, messages, GUIs, holograms. Change it in one place, and every reference updates.
Step 1 â Define a variable under global_variables:
global_variables:
rare_tag: "<!i><bold><#FF8C00>[RARE]</#FF8C00></bold>"
Step 2 â Reference it with the <global:id> tag:
items:
default:topaz_sword:
material: diamond_sword
data:
item_name: "<global:rare_tag> Topaz Sword"
That's it. The <global:rare_tag> tag gets replaced with the variable's content.
Configurationâ
Global variables live under the global_variables section. Each entry is a key-value pair:
global_variables:
rare_tag: "<!i><bold><#FF8C00>[RARE]</#FF8C00></bold>"
vip_prefix: "<!i><gradient:#FFD700:#FFA500>[VIP]</gradient>"
coin_icon: "<!shadow><image:default:coins>"
| Field | Description |
|---|---|
| Key | The variable's ID, used in <global:key>. |
| Value | The MiniMessage content to substitute. Fully supports tags, colors, images, and other variables. |
Using Variablesâ
Basic Usageâ
<global:id>
item_name: "<global:rare_tag> Topaz Sword"
With Argumentsâ
Variables support indexed arguments â <arg:0>, <arg:1>, etc. â that you fill in at the call site:
global_variables:
owner_item: "<!i><#FF8C00><arg:0>'s <arg:1>"
# Pass arguments after the ID, separated by colons
item_name: "<global:owner_item:'<arg:player.name>':'<lang:item.default.topaz_rod>'>"
Here <arg:0> becomes the player's name and <arg:1> becomes the translated item name. Arguments are themselves parsed as MiniMessage, so you can nest tags inside them.
In Other Pluginsâ
Global variables work at the packet level, so they're available in any plugin that sends text through the packets CraftEngine intercepts:
# A hologram config in another plugin
line: "<global:coin_icon> My coins: %vault_eco_balance%"
Packet-level replacement requires the relevant interceptor to be enabled in config.yml â network.intercept-packets.