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

@mattzh72/lodestone

v0.4.0

Published

Rendering and core utilities for programmatic Minecraft scenes (Three.js + WebGL)

Readme

Lodestone

npm release CI CodeQL MIT License

A TypeScript library for rendering Minecraft structures in the browser or headless environments.

Demo

Why Lodestone?

Build interactive Minecraft structure viewers, schematic editors, world previews, or any web-based Minecraft visualization tool. Lodestone handles the complexity of parsing Minecraft's block models, assembling meshes, and rendering them efficiently with Three.js—so you can focus on your application.

Features

  • Litematic file support — Load and render .litematic schematic files (Litematica mod format)
  • Flexible renderingThreeStructureRenderer provides full-featured Three.js rendering
  • Resource pack system — Works with the built-in default pack or your own custom resource packs
  • Advanced rendering — Chunked meshing with occlusion culling, transparency sorting, and emissive block support
  • Universal runtime — Runs in browsers and headless environments with WebGL
  • Full type safety — Written in TypeScript with complete type definitions

Installation

npm install @mattzh72/lodestone

Three.js is a peer dependency. Most package managers (npm v7+) install it automatically:

npm install three

Quick Start

import { Structure, ThreeStructureRenderer, loadDefaultPackResources } from '@mattzh72/lodestone'
import { mat4 } from 'gl-matrix'

const { resources } = await loadDefaultPackResources()

const structure = new Structure([4, 3, 4])
structure.addBlock([0, 0, 3], 'minecraft:stone')
structure.addBlock([0, 1, 3], 'minecraft:cactus', { age: '1' })

const renderer = new ThreeStructureRenderer(canvas, structure, resources)
renderer.setViewport(0, 0, canvas.width, canvas.height)

const view = mat4.create()
mat4.translate(view, view, [0, 0, -5])
renderer.drawStructure(view)

For a complete example with item rendering and controls, see demo/main.ts.

Usage

Loading Litematic Files

Lodestone can load .litematic files (the schematic format used by Litematica mod):

import { LitematicLoader, ThreeStructureRenderer, loadDefaultPackResources } from '@mattzh72/lodestone'

// Load litematic file
const response = await fetch('path/to/build.litematic')
const buffer = await response.arrayBuffer()
const structure = LitematicLoader.load(new Uint8Array(buffer))

// Get metadata
const metadata = LitematicLoader.getMetadata(new Uint8Array(buffer))
console.log(metadata.name, metadata.author, metadata.totalBlocks)

// Render it
const { resources } = await loadDefaultPackResources()
const renderer = new ThreeStructureRenderer(canvas, structure, resources)

The loader handles gzip-compressed NBT parsing, variable-width bit-packed block state arrays, block palettes and properties, and multiple regions (loads first region by default).

CDN Usage (UMD)

Load Three.js first, then Lodestone. The UMD bundle exposes window.Lodestone.

Pinned version (recommended for reproducible builds):

<script src="https://unpkg.com/[email protected]/build/three.min.js"></script>
<script src="https://unpkg.com/@mattzh72/[email protected]/dist/lodestone.umd.cjs"></script>
<script>
  // Load the built-in default pack from unpkg
  (async () => {
    const baseUrl = 'https://unpkg.com/@mattzh72/[email protected]/assets/default-pack/'
    const { resources } = await Lodestone.loadDefaultPackResources({ baseUrl })
    // ...use resources with ThreeStructureRenderer
  })()
</script>

Latest version (convenient but may change):

<script src="https://unpkg.com/[email protected]/build/three.min.js"></script>
<script src="https://unpkg.com/@mattzh72/[email protected]/dist/lodestone.umd.cjs"></script>
<script>
  const { Structure, ThreeStructureRenderer } = window.Lodestone
</script>

Custom Resource Packs

To use your own resource pack instead of the built-in default, provide a Resources object with:

  • Block definitions (blockstates/*.json)
  • Block models (models/*.json)
  • Texture atlas (ImageData) and UV lookup
  • Block flags (opaque, transparent, emissive)

See the demo/ folder for a concrete implementation example.

Development

Run the local demo:

npm install
npm run demo

Contributing

Issues and pull requests are welcome! Visit the issue tracker to report bugs or suggest features.

License

MIT. Lodestone includes upstream MIT-licensed code from Misode.

Acknowledgments

Special thanks to deepslate—Lodestone is an optimized, Three.js-native version of their work.