Skip to main content

🍃 Leafish

A pure Python, asyncio-native Minecraft Java Edition bot framework.

Join servers, chat, move, mine, build, craft, fight, and automate, with no Node.js and no external bot process.

License: MIT Python 3.11+ Status: Alpha

Quick start · Features · Status · Roadmap · Contributing


Why Leafish?

Leafish is inspired by Mineflayer, built for Python developers who want a first-class bot framework in their own language.

  • Pure Python. The Minecraft protocol is implemented natively. Nothing to install beyond Python itself.
  • Async by design. Built on asyncio, so you can run many bots, or a bot alongside a web server, in a single process.
  • Event-driven. Subscribe to what happens in the world with simple decorators.
  • Honest about progress. Features are not advertised until they are implemented and tested. See the implementation status.

✨ Features

Area Goal
Protocol Native Java Edition protocol, multi-version support driven by vendored minecraft-data
Authentication Offline and Microsoft accounts
API Async, event-driven, with plugin support
World model Chunk, entity, and inventory tracking
Automation Pathfinding, digging, placing, crafting, combat, containers

📦 Installation

Requires Python 3.11+.

pip install leafish
Install for development
git clone https://github.com/CybersharpX/Leafish
cd leafish
pip install -e ".[dev]"

🚀 Quick start

import asyncio
from leafish import Leafish


async def main():
    bot = await Leafish.create_bot(
        host="localhost",
        port=25565,
        username="Leafish",
        auth="offline",
    )

    @bot.on("spawn")
    async def on_spawn():
        print("Leafish joined the world!")

    @bot.on("chat")
    async def on_chat(username, message):
        print(f"<{username}> {message}")

    await bot.wait_until_disconnected()


asyncio.run(main())

Start a local Minecraft Java server in offline mode, run the script, and watch the bot join.

Documentation

Documentation of Leafish

📊 Project status

Leafish is built incrementally: protocol layer first, then the bot API, world model, and automation modules.

Document What it covers
IMPLEMENTATION_STATUS.md The current, per-subsystem state of what is implemented and tested
ROADMAP.md Where the project is headed next

🤝 Contributing

Contributions are welcome. To get set up:

git clone https://github.com/CybersharpX/Leafish
cd leafish
pip install -e ".[dev]"

Before opening a pull request, please check IMPLEMENTATION_STATUS.md so your work lines up with what's in progress, and keep docs honest: only document features that are implemented and tested.

📄 License

Released under the MIT License.

Community

Discord: Leafish Discord Server

Want to join me for Leafish's dev ?

Ask me on the Discord.

Metadata

Release files for leafish 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for leafish 0.1.5
File Size Uploaded Provenance Actions
leafish-0.1.5.tar.gz 4.0 MB Without provenance Details for leafish-0.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for leafish 0.1.5
File Interpreter ABI Platform Actions
leafish-0.1.5-py3-none-any.whl Python 3 none any Details for leafish-0.1.5-py3-none-any.whl

Total release size: 8.1 MB

Release files / leafish-0.1.5.tar.gz

Download URL leafish-0.1.5.tar.gz
Size 4.0 MB
Tags Source
SHA-256 checksum
How to use checksums
d26fe398a50a9a75ac3a351109bb4304e901ea078e54aeaacbc9765d1a4afbec
BLAKE2b-256 checksum
How to use checksums
c5400491900f0f71bce5c924011768ac3725808e0991e557d5f8bbd8a57109e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / leafish-0.1.5-py3-none-any.whl

Download URL leafish-0.1.5-py3-none-any.whl
Size 4.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
fa20e43addab48e5bc42a37a2838be366cc60d880ea63e9b2a2a3f2bf929f381
BLAKE2b-256 checksum
How to use checksums
2fa512299c3b2642721b645b1d53d0465c987cb9b36905cf76abc46293453a33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for leafish 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page