twoolie / NBT

Python Parser/Writer for the NBT file format, and it's container the RegionFile.
MIT License
362 stars 74 forks source link

How to convert nbt to json #136

Open skyblockz opened 4 years ago

skyblockz commented 4 years ago

As title, how do i convert the NBTFile object into a json formatted text?

twoolie commented 4 years ago

Walk the NBT tree, and create a tree of dicts in the format you desire, then pass that dict tree to a json encoder.