1.2.1 • Published 4 months ago

mcstructure-js v1.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

MCStructure.js

Icon

A NodeJS package under Upper Narrator Unified Toolpack project. The package provides API to read and write .mcstructure files generated by MCBE. It also can be used in saved structures in MCBE archive db.

This package is avaliable on browser.

Install

npm i mcstructure-js

Usage

Read:

const MCS = require("mcstructure-js")
    , fs = require("fs");

var st = MCS.deserialize(fs.readFileSync("./chests.mcstructre"));

console.log(st.getBlock({x: 0, y: 0, z: 0}));

Write:

const MCS = require("mcstructure-js")
    , PMR = require("project-mirror-registry")
    , fs = require("fs");

var st = new MCS(5, 5, 5)
  , bl = PMR.createUniversalTag("block")
  , be = PMR.createBlockEntity("commandBlock");

bl.name = "minecraft:command_block";
be.Command = "say Hello Minecraft!";

st.setBlock({x: 2, y: 2, z: 2}, bl);
st.setBlockData({x: 2, y: 2, z: 2}, be);

API Document

See API.md.

Relative Repositories

  • Project-Mirror-Registry - A NodeJS package produces template data of MCBE NBT.
  • Narrator.js - A NodeJS package provides API to operate MCBE archive data directly.
  • ParseNBT.js - A NodeJS package for reading and writing NBTs like vanilla JS objects.
1.2.0

7 months ago

1.1.0

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago

0.0.2

8 months ago

1.2.1

4 months ago

0.0.1

9 months ago