NBT is a Named Binary Tag parser based upon the specification by Markus Persson. The tag-based binary format is designed to handle large amounts of binary data with smaller additional data. An NBT file consists of a single GZIPped Named Tag of type TAG_Compound.
The easiest way to read an NBT file is to instantiate an NBTFile object.
Writing files is easy by calling the write_file() method of an NBTFile object.
Creating files involves using the NBTFile object, which is a TAG_Compound with wrapper features.
First, name the top-level tag before adding additional tags.
>>> nbtfile.name = TAG_String("My Top Level Tag")
>>> nbtfile.tags.append(TAG_Float(name="My Float Name", value=3.152987593947))
>>> mylist = TAG_List(name="TestList", type=TAG_Long)
>>> mylist.tags.append(TAG_Long(100))
>>> mylist.tags.extend([TAG_Long(120), TAG_Long(320), TAG_Long(19)])
>>> nbtfile.tags.append(mylist)
>>> nbtfile.write_file("mynbt.dat")
Go to the Softpas website, press the 'Downloads' button, and pick the app you want to download and install—easy and fast!
SoftPas is your platform for the latest software and technology news, reviews, and guides. Stay up to date with cutting-edge trends in tech and software development.
Subscribe to newsletter
© Copyright 2024, SoftPas, All Rights Reserved.