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
Writing
Please check the wiki or the javadocs for more information.
Maven
Links
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 ( ) ;
}
NBTTag tag = in. readNBTTag ( ) ; // This is usually a CompoundTag
// Do stuff with the read tag
} catch ( Exception e ) {
e. printStackTrace ( ) ;
}
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 ( ) ;
}
CompoundTag compoundTag = new CompoundTag ( ) ;
compoundTag. set ( "foo", new StringTag ( "foo", "bar" ) ) ;
out. writeTag (compoundTag ) ;
} catch ( Exception e ) {
e. printStackTrace ( ) ;
}
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>
<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
- Edition: Minecraft Java
- File type: .jar
- Minecraft versions listed: 1.8, 1.9, 1.10
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
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.