cl-nbt
2026-11-29
this library provides simple ways to create Minecraft Bedrock NBT files
Cl-Nbt
a library to generate and read minecraft-bedrock-nbt files
examples
please edit "output-file-path"
compound , number and string tags
(cl-nbt:serialize-tags "output-file-path" (tag-compound "" (list (tag-byte "byte" 1) (tag-short "short" 1) (tag-integer "integer" 1) (tag-long "long" 1) (tag-float "float" 1.0) (tag-double "double" 1.0d0) (tag-string "string" "string"))))
list tags
simple list
(cl-nbt:serialize-tags "output-file-path" (tag-compound "" (list (tag-list "byte-list" '(byte 1 2 3)))))
list in list
(cl-nbt:serialize-tags "output-file-path" (tag-compound "" (list (tag-list "list-list" '(list (byte 1 2 3) (byte 4 5 6))))))
empty list
(cl-nbt:serialize-tags "output-file-path" (tag-compound "" (list (tag-list "void-list" '(byte)))))
or
(cl-nbt:serialize-tags "output-file-path" (tag-compound "" (list (tag-list "void-list" '()))))
compound list
(cl-nbt:serialize-tags "output-file-path" (tag-compound "" (list (tag-list "compound-list" (list 'compound (list (tag-byte "byte" 1)) (list (tag-integer "integer" 1)))))))
parse bedrock nbt
(with-open-file (in "filepath" :direction :input :element-type '(unsigned-byte 8) ) (cl-nbt:parse-tags in))
Running Tests
sbcl --load cl-nbt.asd \ --eval "(ql:quickload :cl-nbt)"\ --eval "(asdf:test-system :cl-nbt)"