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/leafish/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.4

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.4
File Size Uploaded Provenance Actions
leafish-0.1.4.tar.gz 4.0 MB Without provenance Details for leafish-0.1.4.tar.gz

Built distribution (wheel)

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

Total release size: 8.1 MB

Release files / leafish-0.1.4.tar.gz

Download URL leafish-0.1.4.tar.gz
Size 4.0 MB
Tags Source
SHA-256 checksum
How to use checksums
258e9f14e2b0fb02e3269014f180b4f57b4479e9b69d1b0411c11697e15df373
BLAKE2b-256 checksum
How to use checksums
d52cd96820732888a893f082967f91514bf9af5a34a4019a7466bab21d90efcb
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.4-py3-none-any.whl

Download URL leafish-0.1.4-py3-none-any.whl
Size 4.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
3ab45f5b2e59208ecf1b9099b0e703225868d0c409f0e0d8790f074978a6f917
BLAKE2b-256 checksum
How to use checksums
8d42e51f28b2d3bdb8fe39566f51ddff31b770c1cef2ce601997a85ca452cc29
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.4

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