Skip to content

Latest commit

 

History

History
25 lines (23 loc) · 538 Bytes

README.md

File metadata and controls

25 lines (23 loc) · 538 Bytes

anvil-parser

Minecraft Anvil file parser in JS

Usage

Get NBTs from an Anvil file ArrayBuffer

var nbts = anvilToNbt.getNbts(mca)

Parse NBT (requires pako.js in scope)

var parser = new nbtParser.NBTParser();
var result = parser.parse(nbt);

Using with FileReader

var reader = new FileReader();
reader.onload = function(e) {
  var nbts = anvilToNbt.getNbts(reader.result);
  var parser = new nbtParser.NBTParser();
  var result = parser.parse(nbts[0]);
  console.log(result);
};

reader.readAsArrayBuffer(file);