Talk:NBT

From wiki.vg
Revision as of 23:08, 29 November 2011 by Drainedsoul (talk | contribs)
Jump to navigation Jump to search

I find myself a bit confused regarding the TAG_String name thing. I understand that it is used to identify each tag, but the portion which confuses me is that the article implies that not all tags have this name attached to them, "Note that ONLY Named Tags carry the name and tagType data. Explicitly identified Tags (such as TAG_String above) only contains the payload."

Now, my question is, what is considered a named tag, and what is not?

~Thanks

"Tagged" imples: tag type, name, payload. "Untagged" implies just the payload. If you had a TAG_List of TAG_Shorts, each element of the list is *just* the short payload, i.e. 2 bytes per element. As such the children of TAG_Lists are unnamed. TAG_Lists define a "tagId" at the start of their payload so you know what kind of tag you're reading. Named tags exist only in two circumstances: 1) As children of TAG_Compound, 2) As the root node. Barneygale 17:52, 25 November 2011 (MST)
Thanks! Understood.

I have altered the bigtest.nbt example due to the fact the example readout was not correctly representing the UTF-8 encoding actually contained in the document.

The string purported to be "HELLO WORLD THIS IS A TEST STRING !" but was actually "HELLO WORLD THIS IS A TEST STRING ÅÄÖ!"

This can be verified by examining the bytes which make up the string:

   72 69 76 76 79 32 87 79 82 76 68 32 84 72 73 83 32 73 83 32 65 32 84 69 83 84 32 83 84 82 73 78 71 32 195 133 195 132 195 150 33

Using a UTF-8 decoder in "Freeflow Numeric" mode.

~Drainedsoul 15:06, 29 November 2011 (PST)