NBT#
Note
This page contains automatically generated documentation for the NBT module, and is not maintained by minecraft.py.
NBT is licensed under the MIT license, you can view a copy of it here.
Handle the NBT (Named Binary Tag) data format
For more information about the NBT format: https://minecraft.gamepedia.com/NBT_format
- class nbt.nbt.NBTFile(filename=None, buffer=None, fileobj=None)#
Bases:
TAG_CompoundRepresent an NBT file object.
- parse_file(filename=None, buffer=None, fileobj=None)#
Completely parse a file, extracting all tags.
- write_file(filename=None, buffer=None, fileobj=None)#
Write this NBT file to a file.
- class nbt.nbt.TAG(value=None, name=None)#
Bases:
objectTAG, a variable with an intrinsic name.
- id = None#
- namestr()#
Return Unicode string of tag name.
- pretty_tree(indent=0)#
Return formated Unicode string of self, where iterable items are recursively listed in detail.
- tag_info()#
Return Unicode string with class, name and unnested value.
- valuestr()#
Return Unicode string of unnested value. For iterators, this returns a summary.
- class nbt.nbt.TAG_Byte(value=None, name=None, buffer=None)#
Bases:
_TAG_NumericRepresent a single tag storing 1 byte.
- fmt = <_struct.Struct object>#
- id = 1#
- class nbt.nbt.TAG_Byte_Array(name=None, buffer=None)#
Bases:
TAG,MutableSequenceTAG_Byte_Array, comparable to a collections.UserList with an intrinsic name whose values must be bytes
- id = 7#
- insert(key, value)#
S.insert(index, value) – insert value before index
- valuestr()#
Return Unicode string of unnested value. For iterators, this returns a summary.
- class nbt.nbt.TAG_Compound(buffer=None, name=None)#
Bases:
TAG,MutableMappingTAG_Compound, comparable to a collections.OrderedDict with an intrinsic name
- id = 10#
- iteritems()#
- keys() a set-like object providing a view on D's keys#
- pretty_tree(indent=0)#
Return formated Unicode string of self, where iterable items are recursively listed in detail.
- valuestr()#
Return Unicode string of unnested value. For iterators, this returns a summary.
- class nbt.nbt.TAG_Double(value=None, name=None, buffer=None)#
Bases:
_TAG_NumericRepresent a single tag storing 1 IEEE-754 double precision floating point number.
- fmt = <_struct.Struct object>#
- id = 6#
- class nbt.nbt.TAG_Float(value=None, name=None, buffer=None)#
Bases:
_TAG_NumericRepresent a single tag storing 1 IEEE-754 floating point number.
- fmt = <_struct.Struct object>#
- id = 5#
- class nbt.nbt.TAG_Int(value=None, name=None, buffer=None)#
Bases:
_TAG_NumericRepresent a single tag storing 1 int.
- fmt = <_struct.Struct object>#
Struct(“>i”), 32-bits integer, big-endian
- id = 3#
- class nbt.nbt.TAG_Int_Array(name=None, buffer=None)#
Bases:
TAG,MutableSequenceTAG_Int_Array, comparable to a collections.UserList with an intrinsic name whose values must be integers
- id = 11#
- insert(key, value)#
S.insert(index, value) – insert value before index
- update_fmt(length)#
Adjust struct format description to length given
- valuestr()#
Return Unicode string of unnested value. For iterators, this returns a summary.
- class nbt.nbt.TAG_List(type=None, value=None, name=None, buffer=None)#
Bases:
TAG,MutableSequenceTAG_List, comparable to a collections.UserList with an intrinsic name
- id = 9#
- insert(key, value)#
S.insert(index, value) – insert value before index
- pretty_tree(indent=0)#
Return formated Unicode string of self, where iterable items are recursively listed in detail.
- valuestr()#
Return Unicode string of unnested value. For iterators, this returns a summary.
- class nbt.nbt.TAG_Long(value=None, name=None, buffer=None)#
Bases:
_TAG_NumericRepresent a single tag storing 1 long.
- fmt = <_struct.Struct object>#
- id = 4#
- class nbt.nbt.TAG_Long_Array(name=None, buffer=None)#
Bases:
TAG,MutableSequenceTAG_Long_Array, comparable to a collections.UserList with an intrinsic name whose values must be integers
- id = 12#
- insert(key, value)#
S.insert(index, value) – insert value before index
- update_fmt(length)#
Adjust struct format description to length given
- valuestr()#
Return Unicode string of unnested value. For iterators, this returns a summary.