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-highway

v1.0.3

Published

Automatically builds highways in Minecraft using mineflayer with support for instant rebreak and auto refill from ender chests

Downloads

19

Readme

mineflayer-highway

A comprehensive Mineflayer plugin for automated highway construction in Minecraft. This plugin enables bots to build and maintain highways with configurable dimensions, automatic resource management, and advanced mining techniques.

Features

Core Functionality

  • Automated Highway Construction: Builds highways with configurable width and height
  • Directional Support: Supports all 8 directions (4 cardinal and 4 diagonal)
  • Intelligent Pathfinding: Automatically determines the optimal direction based on bot orientation
  • Floor Management: Multiple floor placement modes including replace and place-missing
  • Railing System: Optional railings with corner support blocks
  • Above-Railing Mining: Configurable mining of blocks above railings

Advanced Features

  • Instant Rebreak: Implements instant rebreak mechanics for faster mining
  • Auto Refill System: Automatically restocks from ender chests when resources run low
  • Shulker Box Support: Searches shulker boxes for needed materials
  • Inventory Management: Maintains minimum empty slots for efficient operation
  • Resource Prioritization: Intelligently manages pickaxes, building blocks, and ender chests

Installation

npm install mineflayer-highway

Dependencies

  • mineflayer ^4.0.0
  • vec3 ^0.1.8
  • minecraft-data ^3.0.0

Usage

Basic Example

const mineflayer = require('mineflayer');
const highway = require('mineflayer-highway');

const bot = mineflayer.createBot({
    host: 'localhost',
    port: 25565,
    username: 'HighwayBuilder'
});

bot.loadPlugin(highway);

bot.once('spawn', () => {
    bot.highway.start();
});

Advanced Configuration

bot.once('spawn', () => {
    bot.highway.start({
        width: 5,
        height: 3,
        allowedBlocks: ['obsidian', 'netherite_block'],
        floorMode: 'replace',
        railings: true,
        cornerSupportBlock: true,
        mineAboveRailings: true,
        instantRebreak: true,
        rebreakDelay: 0,
        minEmptySlots: 3,
        searchEnderChest: true,
        saveEnderChests: 2,
        placeRange: 4.5,
        rotation: true
    });
});

Configuration Options

Dimensions

| Option | Type | Default | Description | |--------|------|---------|-------------| | width | Number | 5 | Width of the highway in blocks | | height | Number | 3 | Height of the highway in blocks |

Block Management

| Option | Type | Default | Description | |--------|------|---------|-------------| | allowedBlocks | Array | ['obsidian'] | List of blocks to use for construction | | floorMode | String | 'replace' | Floor placement mode: 'replace' or 'placeMissing' |

Structure Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | railings | Boolean | true | Build railings on both sides | | cornerSupportBlock | Boolean | true | Place support blocks under railings | | mineAboveRailings | Boolean | true | Mine blocks above the railing level |

Mining Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | instantRebreak | Boolean | false | Enable instant rebreak mechanics | | rebreakDelay | Number | 0 | Delay in ticks between rebreak attempts | | rotation | Boolean | true | Enable rotation towards blocks when mining/placing |

Inventory Management

| Option | Type | Default | Description | |--------|------|---------|-------------| | minEmptySlots | Number | 3 | Minimum empty inventory slots to maintain | | searchEnderChest | Boolean | true | Search ender chest for materials | | saveEnderChests | Number | 2 | Minimum ender chests to keep in inventory |

Placement

| Option | Type | Default | Description | |--------|------|---------|-------------| | placeRange | Number | 4.5 | Maximum distance for block placement |

API Reference

Methods

bot.highway.start(options)

Starts the highway building process with optional configuration.

Parameters:

  • options (Object, optional): Configuration options

Returns: Promise

bot.highway.stop()

Stops the highway building process and clears all control states.

Returns: void

bot.highway.stats()

Returns current statistics about the highway building process.

Returns: Object containing:

  • blocksBroken (Number): Total blocks mined
  • blocksPlaced (Number): Total blocks placed
  • distance (Number): Distance traveled from start position

Properties

bot.highway.config

Access to the current configuration object. Can be modified during operation.

State Machine

The plugin operates using a state machine with the following states:

  1. Forward: Moving forward and checking for tasks
  2. MineFront: Mining blocks in front of the bot
  3. MineFloor: Mining floor blocks that need replacement
  4. MineRailings: Mining blocks in railing positions
  5. MineAboveRailings: Mining blocks above the railing level
  6. PlaceFloor: Placing floor blocks
  7. PlaceRailings: Placing railing blocks
  8. PlaceCornerBlock: Placing corner support blocks
  9. Restock: Restocking materials from ender chests

Restocking Process

When the bot runs low on materials, it automatically:

  1. Builds a protective shield (2 blocks tall) in front and at current position
  2. Places an ender chest from inventory
  3. Opens the ender chest and searches for:
    • Shulker boxes containing building materials
    • Raw building blocks (obsidian, etc.)
    • Diamond or Netherite pickaxes
    • Additional ender chests
  4. Takes required items while maintaining minimum empty slots
  5. Mines the ender chest
  6. Removes the protective shield
  7. Resumes highway construction

Requirements

Bot Requirements

  • Diamond or Netherite pickaxe for efficient mining
  • Building blocks (obsidian recommended)
  • Ender chests for restocking (if auto-refill enabled)
  • Shulker boxes with materials (optional)

Server Requirements

  • Server must allow block breaking and placement
  • Sufficient permissions for the bot account

Performance Considerations

  • Instant Rebreak: Provides faster mining but may trigger anti-cheat on some servers
  • Width/Height: Larger dimensions require more resources and time
  • Search Ender Chest: Adds overhead when restocking but provides automation

Troubleshooting

Bot stops unexpectedly

  • Ensure sufficient materials in inventory or ender chest
  • Check that saveEnderChests value allows restocking
  • Verify bot has proper tools for mining

Blocks not placing correctly

  • Adjust placeRange setting
  • Ensure allowedBlocks contains available materials
  • Check that bot is not moving too quickly

Restock not working

  • Verify ender chest contains required materials in shulker boxes
  • Ensure searchEnderChest is set to true
  • Check that minEmptySlots allows room for new items

Contributing

Contributions are welcome. Please ensure all code follows the existing style and includes appropriate documentation.

License

This project is licensed under the GPL-3.0 License. See the LICENSE file for details.

Credits

Inspired by the Highway Builder module from Meteor Client, adapted for use with Mineflayer.

Author

Smol-Hanako

Support

For issues, questions, or contributions, please visit the GitHub repository: https://github.com/Smol-Hanako/mineflayer-highway