An up-to-date and easy to use library for serializing/deserializing Minecraft's named binary tag (NBT) format.
- Serializing takes a tag and a stream to serialize to:
var tag = new StringTag()
{
Value = "Hello, world!"
};
await using var stream = new MemoryStream();
await BinaryTagSerializer.SerializeAsync(tag, stream);
- Deserializing is pretty much the same, but in a reversed way:
await using var stream = new MemoryStream();
var tag = await BinaryTagSerializer.DeserializeAsync<StringTag>(file);
- The compound tag builder provides easy API to build a compound tag:
var tag = CompoundTagBuilder.Create("Parent")
.AddStringTag("Hello, world!")
.AddShortTag(6942)
.Build();
- All collection tags have an indexer for indexing tags/values:
var stringTag = (StringTag) tag[0];
- Compound tag and list tag offer LINQ-like searching methods:
var stringTag = tag.First<StringTag>(name: "Username");