{"repo":"BoogeeDoo/mcnbt","free":true,"listed":false,"github":"https://github.com/BoogeeDoo/mcnbt","clone":"git clone https://github.com/BoogeeDoo/mcnbt.git","description":"Yet another Minecraft NBT format file / buffer parser for Node.js.","language":"JavaScript","stars":23,"topics":["minecraft-nbt-format","minecraft","nodejs","nbt"],"license":"MIT","category":"game-templates","readme_excerpt":"MCNBT Yet another Minecraft NBT format file / buffer parser for Node.js. Installation Usage First require this package into your code: Load & Parse NBT There're several function for you to parse an NBT structure after you instantiating an object: + loadFromBuffer(buff, callback) + loadFromZlibCompressedBuffer(buff, callback) + loadFromFile(filename, callback) + loadFromZlibCompressedFile(filename, callback) All those functions's callback should be written like: For an example: Write Back To NBT Two methods for you to write NBT: + writeToCompressedBuffer(callback, [method]) + writeToBuffer() : returns the buffer (sync) + writeToCompressedFile(filename, callback, [method]) + writeToFile(filename, callback) method is an optional parameter that indicates the zlib algorithm. The default value is 'gzip' . Get Tag(s) After parsing your NBT, you can get the root tag(s). + keys() : get the root tag-key(s) into an array + count() : root tag(s) count + select(tagname) : this function will returns you a instance of tag which named tagname The tag(s) are instance(s) of BaseTag . There're 10 subclasses of BaseTag . Tag Class All the tag classes's parent class is BaseTag . BaseTag and all of the tags have functions below: + getType() : get this tag's type name. eg. 'TAG Compound' + getId() : alias of getType + getTypeId() : get this tag's type id. eg. 'TAG Compound' 's id is 10 + getName() : get this tag's name + getValue() : get this tag's content + setValue(value) : set this tag's value +","default_branch":null,"files":null,"tree":[],"storefront":"/r/BoogeeDoo","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/BoogeeDoo/mcnbt/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}