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

@sectersion/rockbot

v0.1.0

Published

Multi-bot orchestration for Minecraft Bedrock

Readme


Table of Contents


🚀 About

rockbot turns bedrock-protocol's raw packet stream into a Mineflayer-style API — events, entity tracking, movement controls, chat — and then layers a Fleet primitive on top so you can spawn, manage, and coordinate N bots without managing N arrays of EventEmitters.

  • Mineflayer-style per-bot APIbot.chat(), bot.blockAt(), bot.pathfinder.goto(), bot.setControlState(), events, plugins
  • First-class fleet managementcreateFleet() with auth provider integration, named bots, event aggregation, sub-team groups
  • Automatic tick loopPlayerAuthInput at 20hz keeps every bot alive regardless of what user code is doing
  • Entity tracking in real time — position, rotation, metadata for every player in view distance
  • Graceful shutdown — SIGINT/SIGTERM handled, clean disconnect on exit
  • Plugin system — Mineflayer-compatible plugin injection

⚡ Quickstart

Single bot

import { createBot } from 'rockbot'

const bot = createBot({
  host: 'play.lbsg.net',
  username: 'RockBot',
})

bot.on('spawn', () => {
  console.log(`${bot.username} spawned at ${bot.position}`)
  bot.chat('Hello from rockbot!')
})

bot.on('chat', (username, message) => {
  console.log(`<${username}> ${message}`)
})

Fleet of bots

import { createFleet } from 'rockbot'

const fleet = createFleet({
  defaults: { host: 'play.lbsg.net' },
  auth: { provider: 'file', source: './accounts.csv' },
})

fleet.on('spawn', (bot) => console.log(`${bot.username} joined`))
fleet.on('chat', (bot, user, msg) => console.log(`[${bot.name}] <${user}> ${msg}`))

await fleet.spawn(5)
fleet.broadcast('We come in peace.')

📦 Installation

npm install @sectersion/rockbot

Requires Node.js 18+.


📖 API Reference

createBot(options)

| Option | Type | Default | Description | |--------|------|---------|-------------| | host | string | '127.0.0.1' | Server address | | port | number | 19132 | Server port | | username | string | required | Bot name | | offline | boolean | false | Skip Xbox Live auth | | version | string | auto-detect | Protocol version | | viewDistance | number | 8 | Chunk radius | | connectTimeout | number | 9000 | Connection timeout (ms) | | plugins | PluginDeclaration[] | — | Mineflayer-style plugins |

Bot

const bot = createBot({ host: 'localhost', username: 'Bot1', offline: true })

| Method | Returns | Description | |--------|---------|-------------| | bot.chat(msg) | void | Send chat message | | bot.whisper(user, msg) | void | Send private message | | bot.look(yaw, pitch) | void | Set rotation | | bot.lookAt(point) | void | Look at a Vec3 position | | bot.setControlState(control, bool) | void | Set movement flag | | bot.clearControlStates() | void | Reset all movement flags | | bot.quit(reason?) | void | Disconnect cleanly | | bot.end(reason?) | void | Alias for quit |

Movement controls: forward, back, left, right, jump, sneak, sprint

| Property | Type | Description | |----------|------|-------------| | bot.username | string | Current username | | bot.entity | Entity | Self entity (id, position, rotation) | | bot.entities | Map<number, Entity> | All tracked entities | | bot.position | Vec3 | Current position | | bot.rotation | { yaw, pitch } | Current rotation | | bot.health | number | HP (0–20) | | bot.food | number | Hunger (0–20) | | bot.game | object | { dimension, difficulty, gameMode } |

| Event | Arguments | Description | |-------|-----------|-------------| | spawn | — | Bot fully joined the server | | login | — | Authenticated and connected | | chat | (username, message) | Chat message received | | whisper | (username, message) | Private message | | message | (text) | System message | | health | — | HP or food changed | | entitySpawn | (entity) | Entity entered view distance | | entityGone | (entity) | Entity left view distance | | kicked | (reason) | Bot was kicked | | error | (error) | Error occurred | | end | — | Connection closed | | respawn | — | Bot respawned after death | | game | — | Game data received |


createFleet(options)

| Option | Type | Description | |--------|------|-------------| | defaults | Partial<BotOptions> | Default options for every bot | | auth | AuthConfig | Credential provider | | plugins | PluginDeclaration[] | Fleet-level plugins |

Fleet

const fleet = createFleet({
  defaults: { host: 'play.lbsg.net' },
  auth: { provider: 'file', source: './accounts.csv' },
})

| Method | Returns | Description | |--------|---------|-------------| | fleet.spawn(n) | Promise<Bot[]> | Spawn N bots | | fleet.spawn(opts) | Promise<Bot> | Spawn one with per-bot options | | fleet.despawn(name) | — | Disconnect and remove a bot | | fleet.despawnAll() | — | Disconnect all bots | | fleet.bot(name) | Bot \| undefined | Get a bot by name | | fleet.broadcast(msg) | — | Chat from every bot | | fleet.group(names) | Group | Create a sub-team |

| Event | Arguments | Description | |-------|-----------|-------------| | spawn | (bot) | A bot joined | | chat | (bot, username, message) | Any bot heard chat | | kicked | (bot, reason) | A bot was kicked | | end | (bot) | A bot disconnected | | error | (bot, error) | A bot error |

Group

const miners = fleet.group(['miner-1', 'miner-2'])
miners.broadcast('Starting dig job!')
const results = await miners.call('chat', 'ready')

| Method | Description | |--------|-------------| | group.add(bot) | Add a bot | | group.remove(bot) | Remove a bot | | group.broadcast(msg) | Chat from all group members | | group.call(method, ...args) | Call a method on all bots in parallel | | group.on(event, fn) | Forward events from group bots |


🔐 Auth

File provider (CSV)

username,password,email
BotOne,pass123,[email protected]
BotTwo,pass456,[email protected]
createFleet({
  auth: { provider: 'file', source: './accounts.csv' },
})

Environment provider

createFleet({
  auth: { provider: 'env' },
})
// Reads: BOT_USERNAME, BOT_PASSWORD, BOT_EMAIL

Custom provider

import type { AuthProvider, Account } from 'rockbot'

class MyAuth implements AuthProvider {
  async acquire(): Promise<Account> {
    return { username: 'Bot', token: '...' }
  }
  async release(account: Account, reason?: string): Promise<void> {}
}

createFleet({
  auth: { provider: new MyAuth() },
})

🔌 Plugins

Plugins inject functionality into a bot at construction time — same pattern as Mineflayer.

function autoEat(bot: Bot, options?: any) {
  bot.on('health', () => {
    if (bot.food < 6) bot.chat('/eat')
  })
}

const bot = createBot({
  host: 'localhost',
  username: 'Bot',
  offline: true,
  plugins: [[autoEat, { threshold: 10 }]],
})

Fleet-level plugins are automatically applied to every spawned bot.


🏗 Architecture

┌────────────────────────────────────────────┐
│              rockbot                        │
│                                            │
│  Bot           Mineflayer-style per-bot API │
│  ├── events    spawn, chat, health, ...    │
│  ├── tick      PlayerAuthInput at 20hz     │
│  └── plugins   Plugin injection            │
│                                            │
│  Fleet         Multi-bot manager           │
│  ├── spawn()   Auth provider integration   │
│  ├── group()   Sub-team coordination       │
│  └── events    Aggregated from all bots    │
│                                            │
│  AuthProvider  Pluggable credential source  │
└────────────────┬───────────────────────────┘
                 │
┌────────────────▼───────────────────────────┐
│  bedrock-protocol                          │
│  (RakNet, Xbox Live, packet I/O)           │
└────────────────────────────────────────────┘

Dependencies

| Package | Role | |---------|------| | bedrock-protocol | RakNet networking, auth, packet I/O | | vec3 | 3D vector math | | minecraft-data | Block/item ID registry |


🛠 Development

git clone https://github.com/sectersion/rockbot
cd rockbot
npm install
npm run build

Test on a live server

npx tsx test/lifeboat.ts

The first run triggers a Microsoft device-code login flow — visit the printed URL, enter the code, and the bot connects.


📄 License

MIT