jNBT provides a complete solution for NBT file manipulation with both low-level control and high-level convenience:
- 🎯 Complete NBT Support - All tags from the official specification
- 🛠️ Fluent Builder API - Modern builder pattern for easy structure creation
- 📦 Smart Compression - Automatic detection and support for GZIP, ZLIB, and uncompressed files
- 📝 SNBT Support - Parse and generate Stringified NBT for Minecraft commands
- 🔧 Interface-Based Design - Clean APIs
- ⚡ Type Safety - Minimal casting
Read NBT file:
ICompoundTag root = NBTFileFactory.readNBTFile(new File("level.dat"));
String worldName = root.getString("LevelName");Create with Builder:
ICompoundTag player = NBTBuilder.compound("Player")
.addString("name", "Steve")
.addInt("level", 25)
.addCompound("inventory")
.addString("item", "diamond_sword")
.endCompound()
.build();Parse SNBT:
ITag<?> tag = NBTFactory.parseFromSNBT("{display:{Name:\"Custom Item\"}}");Generate SNBT:
SNBTSerializer serializer = new SNBTSerializer();
String snbt = serializer.serialize(tag);- All NBT tag types (Byte, Short, Int, Long, Float, Double, String, List, Compound, Arrays)
- Complete CRUD operations (Create, Read, Update, Delete)
- Compression formats: GZIP, ZLIB, None
- SNBT (Stringified NBT) parsing and generation
- Many concenience methods
- Bedrock Edition NBT support
- Conversion to JSON
- Graphical NBT editor (maybe)
Explore the examples/ folder for comprehensive usage patterns.
mvn clean installAlways backup your files before modification. While thoroughly tested, data corruption is always possible with file manipulation tools.
This library powers:
- jMCX - Edit Minecraft world files
- MinecraftOfflineOnlineConverter - Player data migration
Minecraft is a registered trademark of Mojang AB.