As part of the Unified Community Platform project, your wiki will be migrated to the new platform in the next few weeks. Read more here.
I just created this page because it was sorely needed. Does anyone have any suggestions? LB 01:17, 22 June 2012 (UTC)
- sure: You reverted my changes about the compression method. But this little detail is essential for developers. If you dont want it in the "File Format"-Section then put it somewhere else please. --188.8.131.52 09:12, 12 September 2012 (UTC)
- You can start a new section (eg "Other Formats") and explain when zlib is used. I believe all scenarios are: GZip compressed/uncompressed files, GZip or zlib compressed within region files, and another kind of compression for multiplayer chunk sending. The reason I remove it from the File Format section was because the only NBT files we're aware of (this doesn't include region files) use either GZip or are uncompressed. I know it's lazy of me to revert your edit, but I'm pressed for time (and honestly shouldn't be writing this). I may do it later... LB(T|C) 01:37, 13 September 2012 (UTC)
Differences between NBT Versions
How to check which Program supports which NBT Version? --Sfan5 16:28, 10 December 2012 (UTC)
- There are only two versions of the NBT format - 19132 and 19133. An easy way is to have a firework in your inventory and try to load your level.dat file with the program. If it can't load it, it probably only supports 19132. If it can, it supports 19133. NBTEdit supports 19132, and NBTExplorer supports 19133. LB(T|C) 02:43, 11 December 2012 (UTC)
32,767 UTF-8 Code Points (see UTF-8 format; most commonly-used characters are a single code point).
Not sure if other definitions exist, but as the term is normally used, a unicode code point (see Wikipedia) is the same thing as a character. What is likely meant is "32767 bytes in UTF-8 (see UTF-8 format; most commonly used characters are encoded by a single byte)." Arancaytar 15:10, 26 March 2013 (UTC)
- Actually, no - some characters require multiple code points. Check out these for instance:
- กิิิิิิิิิิิิิิิิิิิิ ก้้้้้้้้้้้้้้้้้้้้ ก็็็็็็็็็็็็็็็็็็็็ ก็็็็็็็็็็็็็็็็็็็็ กิิิิิิิิิิิิิิิิิิิิ ก้้้้้้้้้้้้้้้้้้้้ ก็็็็็็็็็็็็็็็็็็็็ กิิิิิิิิิิิิิิิิิิิิ ก้้้้้้้้้้้้้้้้้้้้ กิิิิิิิิิิิิิิิิิิิิ ก้้้้้้้้้้้้้้้้้้้้ ก็็็็็็็็็็็็็็็็็็็็ ก็็็็็็็็็็็็็็็็็็็็ กิิิิิิิิิิิิิิิิิิิิ ก้้้้้้้้้้้้้้้้้้้้ ก็็็็็็็็็็็็็็็็็็็็ กิิิิิิิิิิิิิิิิิิิิ ก้้้้้้้้้้้้้้้้้้้้
- Oh, okay; I didn't think of clusters. But can the string then truly contain 32767 code points of any kind (up to 4 octets each), rather than 32767 octets? Arancaytar 14:35, 27 March 2013 (UTC)
- Looking at the code, I don't think the page is currently accurate. Writing and reading NBT strings uses the java.io.DataOutput.writeUTF() and java.io.DataInput.readUTF() methods, which employ a slight modification of the UTF-8 standard. The length of the stored data is an unsigned 16-bit integer, which lets it contain up to 65,535 bytes. Each char is encoded as 1-3 bytes; supplementary characters (above U+FFFF) use two chars, so each code point can use up to 6 bytes. Worst-case scenario is as few as 10,922 code points; best case is 65,535 ASCII characters. -- Orthotope 04:11, 28 March 2013 (UTC)
UTF vs binary
The string are UTF8, but does the 2 byte size specify the number of bytes or the number of unicode code points? I am guessing bytes?184.108.40.206 02:24, 21 December 2013 (UTC)
- Minecraft's implementation uses writeUTF, so the size is the number of bytes, not the number of UTF8 code points. LB(T|C) 04:40, 21 December 2013 (UTC)
What about TAG_boolean?
The page says that there are only 12 tag types, yet I've run across TAG_boolean elsewhere on the wiki. (Chunk Format Skull Block Entity) Is there any reason why this isn't included? --Zero318 (talk) 04:51, 16 August 2015 (UTC)
- There is no Boolean type stored for NBT data. The "Value" stored on the skull is a JSON object (encoded) rather than NBT, which does include a boolean. Skylinerw (talk) 12:48, 16 August 2015 (UTC)
Almost every root tag has an empty name string. Almost?
Hi, I'm playing with NBT files and noticed that statement in the wiki:
Additionally, almost every root tag has an empty name string and encapsulates only one Compound tag with the actual data and a name.
All the files I examined seem to start with that "unnamed root compound".
Could someone point me to examples of NBT actually used in Minecraft 1.13+ where the root is not a compound whose name is empty?
-- Sylvain [[[Special:Contributions/220.127.116.11|18.104.22.168]] 21:25, 8 October 2019 (UTC)]