Skip to content

paul-eff/jNBT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jNBT

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

Installation

You can either import the latest relase .jar file directly as a dependency via your IDE.

Or use a build system of your choosing (e.g. Maven):

<dependencies>
    <dependency>
        <groupId>de.pauleff</groupId>
        <artifactId>jnbt</artifactId>
        <version>1.7.0</version>
    </dependency>
<dependencies>

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 convenience 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

Contributing

Stars

Watchers

Forks

Contributors

Languages