NBTReader is a tool to read and write NBT files with Java!
NBTReader is still in development and may have bugs and/or be inefficient!
You can read NBT Files with the NBTReader
class. It has three methods that return a NBTTag
:
fromFile(String filename)
fromInputStream(InputStream in)
fromGzippedFile(String filename)
NBTTag tag = NBTReader.fromFile("./nbt_file");
You can write NBT Files with the NBTWriter
class. It has three methods that write a NBTTag
:
writeToGzippedFile(NBTTag nbtTag, String filename)
writeToFile(NBTTag nbtTag, String filename)
writeToOutputStream(NBTTag nbtTag, OutputStream out)
NBTTag tag = new NBTTag();
NBTReader.writeToFile(tag, "./nbt_file"); // You should catch the IOException!