CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PrismarineJS

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: PrismarineJS/mineflayer
Path: blob/master/examples/python/README.md
Views: 789

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