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

mineflayer-schem

v1.5.2

Published

A mineflayer plugin for building structures from schematic files (modern and legacy) with advanced chest and block support.

Readme

mineflayer-schem

This plugin extends mineflayer to build structures from schematic files, supporting both modern and legacy formats, recent Minecraft versions, and advanced inventory/chest management.

Features

  • Support for schematic files (.schematic, .schem, .litematic, NBT), both modern and legacy formats.
  • Compatible with the latest Minecraft versions (1.8–1.20+).
  • Automatic construction with single or multiple bots.
  • Automatic item retrieval from the nearest chest.
  • Advanced handling of directional blocks, stairs, slabs, and special blocks.
  • Detailed progress tracking and events.
  • Configurable speed and error handling options.
  • Construction statistics and error logging.

Installation

npm install mineflayer-schem

Example Usage

const mineflayer = require('mineflayer');
const { pathfinder } = require('mineflayer-pathfinder');
const { Build, builder } = require('mineflayer-schem');
const { Schematic } = require('prismarine-schematic');
const fs = require('fs').promises;
const path = require('path');

const bot = mineflayer.createBot({
  host: 'localhost',
  port: 25565,
  username: 'BuilderBot',
  version: '1.20.4' // Change according to your server
});

bot.loadPlugin(pathfinder);
bot.loadPlugin(builder);

bot.once('spawn', async () => {
  const schematic = await Schematic.read(
    await fs.readFile(path.resolve(__dirname, './schematic/house.schem')),
    bot.version
  );

  while (!bot.entity.onGround) await new Promise(r => setTimeout(r, 100));

  const build = new Build(schematic, bot.world, bot.entity.position.floored());

  const options = {
    buildSpeed: 1.0,
    onError: 'pause',
    retryCount: 3,
    useNearestChest: true,
    bots: [bot]
  };

  bot.on('builder_progress', (progress) => {
    const percent = Math.floor((progress.completed / progress.total) * 100);
    console.log(`Progress: ${percent}% (${progress.completed}/${progress.total})`);
  });

  bot.on('builder_error', (error) => {
    console.error('Error:', error.message);
  });

  bot.on('builder_finished', () => {
    console.log('Build finished!');
  });

  await bot.builder.build(build, options);
});

API

builder(bot, options)

Injects the builder plugin into the bot.

  • buildSpeed: Build speed multiplier (default: 1.0)
  • onError: Error strategy ('pause', 'cancel', 'retry', 'skip')
  • retryCount: Number of retries on failure (default: 3)
  • useNearestChest: Automatically use nearby chests for items (default: true)
  • bots: Bots collaborating on the build (default: [bot])

Build

new Build(schematic, world, position, area = null)

Creates a new build instance.

  • schematic: Schematic object.
  • world: Bot's world.
  • position: Vec3 where to build.
  • area: Optional area for partial builds.

Properties

  • actions: Pending actions.
  • completedActions: Completed actions.
  • properties: Block properties.
  • isPaused: If build is paused.
  • isCancelled: If build is cancelled.

Methods

  • getAvailableActions()
  • removeAction(action)
  • pause()
  • resume()
  • cancel()
  • getProgress()
  • markActionComplete(action)
  • getItemForState(stateId)
  • getFacing(stateId, facing)
  • getPossibleDirections(stateId, pos)
  • getBuildErrors()

Events

  • builder_progress
  • builder_error
  • builder_paused
  • builder_resumed
  • builder_cancelled
  • builder_finished

Supported Formats

  • .schematic classic (MCEdit)
  • .schem modern (WorldEdit/Minecraft 1.13+)
  • .litematic (Litematica)
  • Raw NBT

Advanced

Automatic Chest Support

The bot detects and retrieves items from the nearest chests as needed for the schematic.

Multi-bot

Multiple bots can collaborate on the same build using the bots option.

Statistics and Errors

Get detailed metrics and errors during the process with getProgress() and getBuildErrors().

Contributing

Pull requests and suggestions are welcome!

License

MIT

Recent Changes

1.5.2

  • Version bump to fix npm publish error.

1.5.1

  • README update and prep for npm publish.

1.5.0

  • Support for modern and legacy schematic formats
  • Automatic detection and usage of the nearest chest
  • Improved error handling and statistics
  • Support for latest Minecraft blocks and properties
  • Performance improvements and multi-bot support

1.4.x

  • Route optimization and new configuration options
  • Basic chest support