Skip to content

nova-27/prismarine-mcstructure-unofficial

Repository files navigation

license Discord

prismarine-mcstructure-unofficial

This library converts between .mcstructure and prismarine-schematic(which can be exported as Sponge Schematic Version 2)

Currently supports mcstructure to prismarine-schematic conversion.

Install

npm install prismarine-mcstructure-unofficial

Usage

const fs = require('fs')
const path = require('path')
const { parseMcStructureBuffer } = require('prismarine-mcstructure-unofficial')

async function sample() {
  const sampleMcStructure = fs.readFileSync(
    path.join(__dirname, 'sample.mcstructure'),
  )
  const schematic = await parseMcStructureBuffer(sampleMcStructure)
  const schemBuffer = await schematic.write()
  fs.writeFileSync(path.join(__dirname, 'sample.schem'), schemBuffer)
}

sample()