LookAtMySuitBot/js/node_modules/mineflayer/examples/python
Brett 5f2b208d42 c++ setup 2023-12-24 20:08:39 -05:00
..
README.md c++ setup 2023-12-24 20:08:39 -05:00
basic.py c++ setup 2023-12-24 20:08:39 -05:00
chatterbox.py c++ setup 2023-12-24 20:08:39 -05:00

README.md

Using mineflayer in Python

  • Checkout the tutorial on Google Colab 👉 Open In Colab

Thanks to JSPyBridge, it is possible to use mineflayer in python!

Install

Make sure you have Python 3.8 or newer installed and also Node.js 14 or newer. You can get them from https://www.python.org/downloads/ and https://nodejs.org/.

You can access mineflayer in Python in addition to any other JavaScript package by first installing the javascript pip package:

pip install javascript

Once you have the package installed, you can put this at the top of your Python:

from javascript import require
mineflayer = require('mineflayer')

... and you're good to go, with full API access. You interact with the API very similarly to JavaScript.

Examples

See also