👨🏻‍💻 Thanks for reading! This blog has been archived and won't have content updates. You can follow my latest work at trujillo.io.

1 minute

I’ve recently been working on a Minecraft bot built in Node.js as part of my final project for my artificial intelligence class. The Minecraft-Node connection is possible thanks to a library called Mineflayer which acts as a Javascript bridge between Minecraft and Node.

So far the bot can do the following things:

  • Stare silently at the last player who talked in the chat
  • Pick up dirt blocks from a pre-set resource area
  • Navigate around (using the Mineflayer-Scaffold plugin)
  • Keep track of state using a Knowledge Base
  • Respond to events through logic rules
  • Execute tasks by priority and dependencies (Example: Go to resource site before digging, or prioritize fighting back from digging)

The final goal is to have the bot build a simple column it can climb at night so it can survive longer than a day, and possibly have it build other things during the day.


Source code

Test it yourself or make your own changes: The source code is available at http://github.com/etcinit/minebot. It requires Minecraft 1.8 (not lower or higher) to work.

Copyright © 2015-2021 - Eduardo Trujillo
Except where otherwise noted, content on this site is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) license.
Site generated using Gatsby.