A small experimental Minecraft bot project. The long‑term idea is to let a Minecraft bot “attempt to gain sentience” by having an LLM write/modify its Mineflayer behaviors, then periodically self‑review and iterate. Today, this repo is a minimal multi‑bot Mineflayer harness you can run locally.
- Spawns multiple Mineflayer bots with staggered connections.
- Logs lifecycle events (connect, spawn, kicked, error, disconnect).
- Makes each bot jump once per second after spawning.
The intended loop is:
- An LLM proposes or writes Mineflayer behaviors.
- The bot runs those behaviors in‑game.
- A periodic “check‑in” prompts the LLM to review outcomes and adjust the code.
That LLM loop is not implemented yet in this repo; this README documents the concept so it’s clear where the project is heading.
- Node.js (current LTS recommended)
- A Minecraft server you can connect to
npm installnpm startnpm run start:bg
tail -f bot.logStop it:
npm run stop:bgHard restart:
npm run restart:bgLogs:
npm run logs:bgReload skills (sends SIGUSR1):
npm run reload:bgnpm run watch:skillsSend a whisper to the bot:
!follow(follows the sender)!follow <playerName>(follows a specific player)!stop(stops following)
The bot will refuse to follow while in survival mode (low health/food).
Edit these constants in bot.js:
BOT_COUNT: number of bots to spawnHOST: server hostPORT: server portVERSION: Minecraft protocol version (must match your server)CONFIG.sensorIntervalMs: sensor output intervalCONFIG.adminUsers: usernames allowed to run chat commandsCONFIG.allowAllReload: allow any user to run the reload commandCONFIG.reloadCommand: chat command string for reloadCONFIG.nearbyRange: radius for nearby entity listing
- The bots use
auth: 'offline'. If you connect to an online‑mode server, you will need to implement proper authentication. - If you change the server version, update
VERSIONaccordingly.
- Add a “code‑generation” layer that calls an LLM to write Mineflayer behaviors.
- Add a periodic supervisor that evaluates behavior and suggests changes.
- Sandboxed execution and safety checks for LLM‑generated code.
Skills live in skills/ and are auto‑loaded at startup. Each file exports a function:
(bot, ctx) => { /* wire events, behavior, sensors */ }
The context includes:
ctx.username: bot namectx.logSensor(label, value): logging helperctx.formatVec(vec): coordinate formatterctx.config: shared configuration (e.g.sensorIntervalMs)ctx.on(emitter, event, handler): tracked event listenerctx.setInterval(fn, ms): tracked interval
You can reload all skills without disconnecting:
- Send
!reloadin chat (allowed byCONFIG.adminUsersorCONFIG.allowAllReload). - Send
SIGUSR1orSIGUSR2to the Node process.
Note: changes to bot.js still require a full process restart. Skill changes do not.
MIT (add a LICENSE file if you want to make this explicit).