HomeJavaMods[API] NBTLibrary [Spigot/Standalone]
This API allows you to manipulate NBT data and to read/write it from/to files. (Even without spigot)
You can also use it to convert from/to NMS NBT-data.
It even includes some useful annotations to make reading/writing really easy.


Usage

Reading
Code (Java):
try (NBTInputStream in = new NBTInputStream ( new FileInputStream ( new File ( "myNbtFile.nbt" ) ) ) ) {
    NBTTag tag = in. readNBTTag ( ) ; // This is usually a CompoundTag
    // Do stuff with the read tag
} catch ( Exception e ) {
    e. printStackTrace ( ) ;
}
Writing
Code (Java):
try (NBTOutputStream out = new NBTOutputStream ( new FileOutputStream ( "myNbtFile.nbt" ) ) ) {
    CompoundTag compoundTag = new CompoundTag ( ) ;
    compoundTag. set ( "foo", new StringTag ( "foo", "bar" ) ) ;
    out. writeTag (compoundTag ) ;
} catch ( Exception e ) {
    e. printStackTrace ( ) ;
}
Please check the wiki or the javadocs for more information.


Maven
Code (XML):
<repositories>
    <repository>
        <id>inventive-repo </id>
        <url>https://repo.inventivetalent.org/content/groups/public/ </url>
    </repository>
</repositories>
<dependencies>
    <dependency>
        <groupId>org.inventivetalent </groupId>
        <artifactId>nbt-lib </artifactId>
        <version>VERSION </version>
    </dependency>
</dependencies>

Links
Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

[API] NBTLibrary [Spigot/Standalone] is a free Minecraft Java mod. Compatible with Minecraft 1.8, 1.9, 1.10. Downloaded 469 times (via Spigot). Download it and open it directly in the game.

Explore more