macro_rules! nbt {
($($nbt:tt)+) => { ... };
}Expand description
Produce a Value using
JSON/SNBT-like
syntax.
Example:
use fastnbt::nbt;
let _ = nbt!({
"key1": "value1",
"key2": 42,
"key3": [4, 2],
});Unlike SNBT, key/field names for compounds need quoted strings. "key1"
above could not be simplified to just key1.
NBT Arrays are supported with SNBT syntax:
let _ = nbt!({
"bytes": [B; 1, 2, 3],
"ints": [I; 1, 2, 3],
"longs": [L; 1, 2, 3],
});