A C++ library to work with Minecraft's NBT files. It uses modern C++ features like std containers, templates and more.
Minecraft uses its own JSON analog for tree data storage which is called NBT. It is used in many places of the game and is present in binary and text forms. This library currently only supports the binary NBT format, however the text format may also be supported in future.
This library is one of the few I could find at all, so i guess it could be pretty useful for scripts or other apps.
This lib supports cmake which is the preferred way of using it.
git submodule add https://github.com/JaanDev/nbtpp.git
- In your
CMakeLists.txt
:# You can change the default options here (see CMake options) add_subdirectory(nbtpp) ... target_link_libraries(<your project name> PRIVATE nbtpp)
- In your code:
#include <nbtpp.hpp> // check examples dir in the repo for some examples!
Name | Desc | Default |
---|---|---|
NBTPP_EXAMPLES | Build nbtpp examples | OFF |
NBTPP_ZLIB | Build nbtpp with zlib support for compressed files | ON |
See the examples dir at the repo for some comprehensive examples.
Feel free to open an issue or send a pull request. They are always welcome =)
jaan2897
on Discord.