Skip to main content

đŸ”ĸ Global Variables

Introduction​

A global variable is a type of variable that can be accessed in any context and is widely applicable in various scenarios such as expressions and item data.

Here is a basic example, where tags in the format <arg:0> are optional parameters that can be dynamically provided by the caller:

global-variables:
test: "<!i><#FF8C00><arg:0>'s <arg:1>"
items:
default:topaz_rod:
client-bound-data:
item-name: "<global:test:'<arg:player.name>':'<i18n:item.topaz_rod>'>"
tip

CraftEngine's global variables are also accessible to other plugins, though it should be noted that their implementation operates through text replacement at the packet level. This approach does not interfere with the functional logic or internal operations of the recipient plugins.

global-variables:
coin_without_shadow: "<!shadow><image:default:icons>"
# Hologram configuration in another plugin
line: "<global:coin_without_shadow> My coins: %vault_eco_balance%"