Skip to content
/ uNBT Public

Simple Pythonic library for reading and writing NBT data

License

Notifications You must be signed in to change notification settings

Metaray/uNBT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

μNBT

Simple Pythonic library for reading and writing files in Minecraft's Named Binary Tag (NBT) format.

Includes some additional utilities for reading world save data.

Example

Reading level.dat and displaying info about player position:

import uNBT as nbt

level = nbt.read_nbt_file('level.dat')
pos_tag = level['Data']['Player']['Pos']
print(repr(pos_tag))

x, z = pos_tag[0].value, pos_tag[2].value
print('Chunk:', int(x // 16), int(z // 16))

Output:

TagList(TagDouble, [TagDouble(388.5), TagDouble(93.62000000476837), TagDouble(-790.5)])
Chunk: 24 -50

Notes

  • Only big-endian NBT (used by java version) is supported
  • Currently treats strings as UTF-8 instead of MUTF-8

About

Simple Pythonic library for reading and writing NBT data

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages