Skip to content
This repository was archived by the owner on Jul 26, 2024. It is now read-only.

CubicMC/libnbt

 
 

Repository files navigation

libnbt

Description

libnbt is a C/C++ single-header library for working with the NBT format used by Minecraft.

libnbt can:

  • Read NBT files, both uncompressed and compressed (in both the zlib and Gzip formats).
  • Create and modify in-memory NBT structures.
  • Write in-memory NBT structures, both uncompressed and compressed (supporting both zlib and Gzip as with reading).
  • Use the new long array tag added in Minecraft 1.12.

libnbt does yet not provide support for:

  • Reading .mca files used for storing regions.
  • Working with the SNBT format.

These are likely to be added in the future.

Usage Instructions

libnbt is dependent on zlib.

To use this file, you need to put this:

#define NBT_IMPLEMENTATION

in one C/C++ source file before #includeing nbt.h. You may find that creating a dedicated source file with just this #define and the #include may be easiest.

Documentation

Documentation for the library is available here.

Licence

libnbt
Written in 2019 by IDidMakeThat

To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.

You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see http://creativecommons.org/publicdomain/zero/1.0/.

The original bigtest.nbt (made available here in three different formats) can be found here.

About

A C/C++ single-header library for working with the NBT format used by Minecraft

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • C 99.6%
  • Makefile 0.4%