nbt-encode
Converts typed NBT JSON documents into Java Edition NBT bytes as base64, uncompressed or gzip, enabling round-trip with nbt-decode. Malformed documents fail with a node-specific error.
Instructions
Encode a typed NBT JSON document, as nbt-decode returns it, into Java Edition NBT bytes as base64, uncompressed or gzip. A malformed document fails with ERR_NBT_INVALID_TYPED_JSON naming the node. Example: {"typedJson":{"rootName":"R","root":{"type":"compound","value":{"answer":{"type":"int","value":42}}}},"compression":"gzip"}
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"typedJson": "<typedJson>"
},
"name": "nbt-encode"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| typedJson | Yes | Typed NBT document {rootName, root}; every node is {type, value}, as nbt-decode returns. | |
| compression | No | gzip compresses the output. | none |