Skip to content

paul-eff/jNBT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jNBT v1.7.0

Version Minecraft Java License

A modern, efficient Java library for reading, editing, and writing Minecraft NBT files

✨ Features

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

🚀 Quick Start

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);

📋 Status

✅ Supported

  • 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

🔮 Future Plans

  • Bedrock Edition NBT support
  • Conversion to JSON
  • Graphical NBT editor (maybe)

📖 Documentation

Explore the examples/ folder for comprehensive usage patterns.

📦 Building

mvn clean install

⚠️ Important Notice

Always backup your files before modification. While thoroughly tested, data corruption is always possible with file manipulation tools.

🔗 Related Projects

This library powers:

📚 References

Remark

Minecraft is a registered trademark of Mojang AB.

About

A modern, efficient Java library for reading, editing, and writing Minecraft NBT files

Topics

Resources

License

Stars

Watchers

Forks

Languages