Kinecraft Serialization
This library provides tools for serializing and deserializing various Minecraft data types, including NBT tags, chat components, and ByteBuf, using any serializable objects.
The library is written in Kotlin and closely integrates with kotlinx.serialization. A key feature is specialized tag serializers that allow working with tags as objects of the correct type rather than just strings. This ensures proper encoding and decoding of data according to the format being used.
Usage
repositories {
exclusiveContent {
forRepository {
maven("https://api.modrinth.com/maven") {
name = "Modrinth"
}
}
filter {
includeGroup("maven.modrinth")
}
}
}
dependencies {
val kinecraftSerializationVersion = "1.6.7"
compileOnly("maven.modrinth:kinecraft-serialization:$kinecraftSerializationVersion:common")
// Fabric Loom
runtimeOnly("maven.modrinth:kinecraft-serialization:$kinecraftSerializationVersion:fabric")
include("maven.modrinth:kinecraft-serialization:$kinecraftSerializationVersion")
// NeoGradle
runtimeOnly("maven.modrinth:kinecraft-serialization:$kinecraftSerializationVersion:neoforge")
jarInJar("maven.modrinth:kinecraft-serialization:$kinecraftSerializationVersion")
}
The MinecraftTag format is designed for conversion between data classes and Minecraft tags. For a deeper understanding of the functionality, it's recommended to study the test examples for working with tags and ByteBuf.