Skip to content

template

‮(gorg) edited this page Jul 10, 2022 · 2 revisions

Template

In Minecraft

I'm expecting you know how to get template items This is how they appear in Minecraft, in items created by df, including how the data is encoded.
A server-sided way of seeing the data of a template data is by getting a template, holding it and running /i nbt
In PublicBukkitValues.hypercube:codetemplatedata there will be a string of encoded json which contains info about the template.

codetemplatedata

It is json, but stringified in the item data. The json goes as such

{
    "author": string,  // The name of the player who picked up the codeline/template
    "name": string,    // The name of the template, this is dynamicly set based of the start of the line when picking up.
    "version": number, // The version of the template encoding. I've only seen 1.
    "code": string,    // The encoded data of what code blocks is the template.
}

code

This is how encoded data works. Info Source
Raw data is in JSON, which is then compressed with gzip, then finally turned into base64.
The data generally starts with H4sIAAAAAAAA in base64.
You shouldn't work with raw gzip data, since null bytes are hard to copy and paste. Instead you should do both ungzip and base64 at once (like most tools)

template

This is how decoded data works. (Info found via personal research)
The data is a JSON object, but only has one value, blocks. This is an array of all the blocks.

Clone this wiki locally