npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@taku128/bedrock-nbt-converter

v2.0.0

Published

Convert Bedrock .mcworld / .mcstructure files to Java Structure NBT format using Chunker-derived mappings. Meta-package that re-exports @taku128/core, @taku128/mcstructure, and @taku128/mcworld.

Readme

bedrock-nbt-converter

Bedrock Edition の .mcworld / .mcstructure ファイルを Java Edition の Structure NBT (.nbt) 形式に変換するライブラリ+CLI。

deepslate や nbtViewer 等の Java NBT 互換ツールで Bedrock のワールドデータを 3D レンダリングできます。

インストール

npm install @taku128/bedrock-nbt-converter

API 使用例

.mcstructure → Java NBT

import { convertMcstructure } from '@taku128/bedrock-nbt-converter';
import fs from 'fs';

const result = await convertMcstructure('./my-build.mcstructure');
fs.writeFileSync('output.nbt', result.nbt);

console.log(result.size);       // [10, 106, 8]
console.log(result.blockCount); // 5015

.mcworld → Java NBT(座標範囲指定)

import { convertMcworld } from '@taku128/bedrock-nbt-converter';
import fs from 'fs';

const result = await convertMcworld('./world.mcworld', {
  minX: -5, maxX: 4,
  minY: -50, maxY: 55,
  minZ: 16, maxZ: 23
});
fs.writeFileSync('region.nbt', result.nbt);

Buffer API(React/Angular等のブラウザ用途)

import { convertMcstructureBuffer } from '@taku128/bedrock-nbt-converter';

// File API から取得した ArrayBuffer を直接変換
const file = event.target.files[0];
const buffer = new Uint8Array(await file.arrayBuffer());
const result = await convertMcstructureBuffer(buffer);
// result.nbt → gzipped Java Structure NBT (Buffer)

内部低レベル API (カスタムパース等)

独自のチャンクループなどを実装したい開発者向けに、サブチャンクのみの解読やNBTバッファの構築を行う低レイヤーAPIも公開しています。

import { parseSubChunk, buildStructureNbt } from '@taku128/bedrock-nbt-converter';

// 1. Bedrock LevelDB から読みだした生の Value (Buffer) を渡す
const decodedChunk = parseSubChunk(rawSubChunkBuffer);
// { palette: [{ name: 'minecraft:stone', properties: {} }], blocks: Uint16Array(4096) }

// 2. 任意のサイズとブロック情報から Java Structure NBT を構築
const nbtBuffer = buildStructureNbt({
  size: [10, 10, 10],
  palette: [ { Name: "minecraft:stone" } ],
  blocks: [ { pos: [0, 0, 0], state: 0 } ]
});

ブロックマッピング単体利用

import { mapBlock } from '@taku128/bedrock-nbt-converter';

const java = mapBlock('minecraft:concrete', { color: 'gray' });
// { name: 'minecraft:gray_concrete', properties: {} }

CLI

# .mcstructure → .nbt
npx bedrock-nbt-converter build.mcstructure -o build.nbt

# .mcworld → .nbt(座標範囲指定)
npx bedrock-nbt-converter world.mcworld -o region.nbt \
  --min-x -10 --max-x 10 --min-y -64 --max-y 64 --min-z -10 --max-z 10

# ヘルプ
npx bedrock-nbt-converter --help

CLI オプション

| オプション | 説明 | |------------|------| | -o, --output <path> | 出力ファイルパス | | -f, --format <type> | mcworld | mcstructure(拡張子から自動判定) | | --min-x, --max-x <n> | X座標フィルタ(mcworld のみ) | | --min-y, --max-y <n> | Y座標フィルタ(デフォルト: -64〜320) | | --min-z, --max-z <n> | Z座標フィルタ(mcworld のみ) | | --dimension <n> | 0=オーバーワールド, 1=ネザー, 2=エンド |

返り値

すべての変換関数は以下の形式のオブジェクトを返します:

{
  nbt: Buffer;         // gzip圧縮された Java Structure NBT
  size: number[];      // [x, y, z] 構造体サイズ
  blockCount: number;  // 非airブロック数
  paletteCount: number; // パレットエントリ数
}

依存関係

License

This project is licensed under the MIT License. See the LICENSE file for details.

Credits & Acknowledgements

This project's block mapping logic and JSON lookup data (data/chunker-mappings.json) are heavily derived from the source code of the Chunker project by Hive Games, which is an actively maintained Bedrock & Java conversion tool. The extracted data is distributed under the terms of Chunker's MIT License. We extend our sincere gratitude to Hive Games for making their comprehensive mapping data open source.