Minecraft multiplayer client with a bot scripting interface. Currently supporting protocol for Minecraft Beta 1.8.1.
Homepage: http://mineflayer.com
Online API Documentation http://mineflayer.com/doc/html/mf.html - automatically compiled and uploaded when repository is updated.
This project is no longer maintained. Sorry.
Should I decide to resume development work, I would re-do it as a node.js module.
-
Install prerequisites:
sudo apt-get install qt4-dev-tools -
Create a build folder OUTSIDE the source code tree:
mkdir ../mineflayer-build cd ../mineflayer-build/ -
Optionally disable script debugging support (not recommended). This removes any dependency on an X server:
echo "CONFIG += headless" > ../config.pro -
Run qmake once:
qmake ../mineflayer/mineflayer.pro -
Build with
make:make -
Optionally install
mineflayerto/usr/bin:INSTALL_ROOT=/usr sudo make install
-
Download the Qt SDK for Mac from http://qt.nokia.com/downloads/
-
Create a build folder OUTSIDE the source code tree and cd to it.
-
Optionally enable headless mode:
echo "CONFIG += headless" > ../mineflayer-script/config.pro -
Run qmake:
qmake -spec macx-g++ path/to/mineflayer.pro -
Now whenever you want to build, use
make.
- Download and install the Qt SDK: http://qt.nokia.com/downloads/
- Open
mineflayer.prowith Qt Creator - Click
Projects, and change the build configuration fromDebugtoRelease. Build->Build All. This generates:mineflayer-core.dllin your library build directory which ismineflayer-build-desktop/mineflayer-core/relasejust outside themineflayerdirectory.mineflayer.exein your build directory which ismineflayer-build-desktop/mineflayer-script/relasejust outside themineflayerdirectory.
- Put the absolute path of your library build directory in your
PATHvariable. - Copy a bunch of DLLs from Qt into the build directory or put these locations in your
PATHvariable:- from
C:\Qt\[version]\mingw\bin:libgcc_s_dw2-1.dllmingwm10.dll
- from
C:\Qt\[version]\qt\bin:QtCore4.dllQtGui4.dllQtNetwork4.dllQtScript4.dllQtScriptTools4.dll
- from
mineflayer bot.js
If the bot depends on any of the lib files you'll need to pass the lib folder like this:
mineflayer -I<path_to_lib> bot.js
Alternately, you can put the lib folder in an environment variable called MINEFLAYER_LIB.
To connect to a server that requires authentication:
mineflayer --url username@server --password 12345 bot.js
NOTE: all parameters passed after the bot .js file are parameters passed to the bot script itself rather than mineflayer.
The script examples/multi.js is a meta-script that includes most all of the useful bot scripts found in the examples/ directory. Here's an example invocation command from the build directory (this assumes you don't have a MINEFLAYER_LIB variable defined):
mineflayer -I../mineflayer/lib/ --url BOT_USER_NAME@SERVER_HOSTNAME ../mineflayer/examples/multi.js --master=YOUR_USER_NAME --setup="jesusmode on" --setup="healthreport on"
Explanations of the --master and --setup commands can be found in lib/chat_commands.js. If you and your bot are logged in, say "help" via chat for a list of known chat commands (such as "jesusmode" and "healthreport").
- See
doc/bot-apifor comprehensive API documentation. - See
libs/for more utility functions. - See
examples/for examples of bot code.
ECMAScript reference: http://doc.qt.nokia.com/latest/ecmascript.html
Command will look something like:
../mineflayer-build-desktop/mineflayer bin/run_tests ~/apps/minecraft-server-1.5/minecraft_server.jar ../mineflayer-build-desktop/mineflayer