Expand description
The typed values’ string forms — one grammar for every format:
| Written | Value |
|---|---|
@item:minecraft:stick, @block:minecraft:furnace[facing=north] | Value::Ref |
@tag:item:minecraft:planks | Value::Tag |
@Strings.screen.title (set names start upper case) | Value::Res |
@image:sprite:button, @image:mymod:gui/logo | Value::Image |
@lang:gui.done (a key as in the lang files) | Value::Lang |
#RRGGBB, #AARRGGBB | Value::Color |
@@text | the plain string @text |
A string that starts with @ is always one of these (or an error), in
any field — so a typo in a reference is never silently plain text.
Functions§
- classify
sas a typed value if it’s written as one (@…), the plain string otherwise;@@escapes a leading@.- escape_
at swith a leading@doubled, so it reads back as plain text.- format_
color 0xAARRGGBB→#RRGGBBwhen opaque, else#AARRGGBB.- is_
res_ key - A resource key: identifiers joined by
.(screen.title); after the first, a part may start with a digit (item.robes.2_boots). - parse_
color #RRGGBB(opaque) or#AARRGGBB→0xAARRGGBB.- resource_
id - A content id:
namespace:path(namespace defaults tominecraft), lower case, with an optional[state]/{nbt}suffix kept as written. - typed_
string - The string form of a typed value (
Nonefor the untyped ones).