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

cubane

v1.0.19

Published

A Three.js-based Minecraft block and entity renderer with resource pack support

Readme

Cubane

A Three.js-based Minecraft block and entity renderer that supports resource packs, animated textures, and block states.

Features

  • Load official Minecraft resource packs directly
  • Render blocks with accurate models and textures
  • Support for block states and variants
  • Special liquid rendering for water and lava with animations
  • Entity rendering (chests, signs, etc.)
  • Automatic resource pack caching using IndexedDB
  • Biome-specific block tinting

Installation

npm install cubane three
# or
yarn add cubane three

Basic Usage

import * as THREE from "three";
import { Cubane } from "cubane";

// Setup Three.js
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(
	75,
	window.innerWidth / window.innerHeight,
	0.1,
	1000
);
const renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);

// Create Cubane instance
const cubane = new Cubane();

// Load a resource pack
async function init() {
	// Load from file input
	const fileInput = document.getElementById("resource-pack");
	fileInput.addEventListener("change", async (e) => {
		const file = e.target.files[0];
		await cubane.loadResourcePack(
			{
				packId: "default-pack",
				useCache: true,
			},
			async () => file
		);

		createBlocks();
	});

	// Try loading from cache first
	const loaded = await cubane.loadMostRecentPack();
	if (loaded) createBlocks();
}

// Create some blocks
async function createBlocks() {
	// Simple stone block
	const stone = await cubane.getBlockMesh("minecraft:stone");
	stone.position.set(0, 0, 0);
	scene.add(stone);

	// Block with state
	const log = await cubane.getBlockMesh("minecraft:oak_log[axis=y]");
	log.position.set(0, 1, 0);
	scene.add(log);

	// Water with level
	const water = await cubane.getBlockMesh("minecraft:water[level=2]");
	water.position.set(1, 0, 0);
	scene.add(water);

	// Entity
	const chest = await cubane.getEntityMesh("chest");
	chest.position.set(1, 1, 0);
	scene.add(chest);
}

// Animation loop
function animate() {
	requestAnimationFrame(animate);

	// Update animations (water, lava, etc.)
	cubane.updateAnimations();

	renderer.render(scene, camera);
}

init();
animate();

API Reference

Cubane

Main class that handles block rendering, resource packs, and animations.

Methods

  • loadResourcePack(options, loader) - Load a resource pack with caching options
  • getBlockMesh(blockString, biome?, position?) - Get a Three.js mesh for a block
  • getEntityMesh(entityType, position?) - Get a Three.js mesh for an entity
  • updateAnimations() - Update animated textures (call in render loop)
  • loadMostRecentPack() - Load the most recently used resource pack from cache
  • listCachedResourcePacks() - List all resource packs in the cache
  • loadCachedPack(packId) - Load a specific resource pack from cache by ID
  • deleteCachedPack(packId) - Delete a resource pack from cache
  • dispose() - Clean up resources

Block States

Cubane supports Minecraft's block state syntax:

minecraft:block_name[property1=value1,property2=value2]

Examples:

  • minecraft:stone - Basic stone block
  • minecraft:oak_log[axis=y] - Oak log oriented along Y axis
  • minecraft:water[level=3] - Water with level 3
  • minecraft:chest[facing=north] - Chest facing north

License

This project is licensed under the GNU Affero General Public License v3.0 - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.