Overview • Usage • Features • Javadocs • License
NBT (Named Binary Tag) is a binary format devised by Notch to be Minecraft's primary means of data storage.
There are 12 types of tag that can be used in a complaint NBT file (see TagType.java for descriptions of each):
All valid NBT structures begin with a compound tag; the root compound. Everything else in the NBT structure is a child of this root compound.
This library can be added as a dependency via maven central:
repositories {
mavenCentral()
}
dependencies {
implementation "dev.dewy:nbt:1.3.0"
}
The Nbt class can be used to easily (de)serialize NBT data:
public static final Nbt NBT = new Nbt();
CompoundTag test = NBT.fromBase64("CgALaGVsbG8gd29ybGQDAAR0ZXN0AAAAAAA");
System.out.println(test.getName()); // hello world
System.out.println(test.<IntTag>get("test").getValue()); // 0
See the NbtTest class for full sample usage.
- Fully compliant with Mojang's "standards"
- Small and lightweight (36Kb!)
- Supports all Java edition NBT tags (including long array)
- Intuitive and flexible reading and writing functionality
- SNBT (Stringified NBT) support
- ENBT (Extended NBT) format (missing data types e.g., double array) support
- JSON (De)serialization
Javadocs for the library can be found here.
This project is licensed under the MIT license: see here.