https://github.com/devmattrick/enbeet
A modern Minecraft NBT library.
https://github.com/devmattrick/enbeet
deserialization enbeet game hacktoberfest java library maven minecraft nbt serialization
Last synced: about 2 months ago
JSON representation
A modern Minecraft NBT library.
- Host: GitHub
- URL: https://github.com/devmattrick/enbeet
- Owner: devmattrick
- License: mit
- Created: 2021-06-22T00:40:23.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-06-23T23:59:54.000Z (almost 4 years ago)
- Last Synced: 2025-02-10T11:11:16.894Z (3 months ago)
- Topics: deserialization, enbeet, game, hacktoberfest, java, library, maven, minecraft, nbt, serialization
- Language: Java
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# enbeet
enbeet is a modern Java NBT library. Its codebase is intentionally small and easy to understand. It makes extensive use
of the Optional API to make null handling much more explicit and safer.## Installation
Enbeet is on Maven Central, so you don't need to include any repositories to use it. Simply add the following to your
pom.xml:
```xmlorg.mattrick
enbeet
1.0.2```
## Usage
```java
// Reading NBT
NBTReader reader = new NBTReader(new FileInputStream("example.nbt"));
NBTCompound compound = reader.read();// Getting a value
System.out.println(compound.getString("test").get());// Getting a nested value. Each level is a separate argument.
// Note that keys can contain dots unlike other libraries.
System.out.println(compound.getString("nested value", "test.Value", "aaaa").get());// Setting values
// Note that the type matters here. ints will be written as IntTag, etc...
compound.set(10, "some", "nested", "key");// Writing NBT
NBTWriter writer = new NBTWriter(new FileOutputStream("output.nbt"));
writer.write(compound);
```