package
0.0.0-20220204145510-d0f2f64e1aa0
Repository: https://github.com/bytesizedmarius/go-minecraft-wrapper.git
Documentation: pkg.go.dev

# README

SNBT

SNBT (Stringified Name Binary Tag) is a file format introduced by Minecraft to save its data. While there are some already exist good packages to decode those files, the server logs prints its stringified counterpart. This lightweight package is meant to decode a given SNBT to a Go struct.

Basic Usage

bytesToDecode := []byte(`{Base: 1.0d, Name: "minecraft:generic.attack_damage"}`)

bytesStruct := struct {
    Base float64
    Name string
}{}

snbt.Decode(bytesToDecode, &bytesStruct)

fmt.Printf("%+v", bytesStruct) // {Base:1 Name:minecraft:generic.attack_damage}

Resources