MineMind
Low-level API for creating minecraft bots.
Supported Versions
- 1.20.3
Installation
pip install minemind
Example
Say hello world to the server.
import asyncio
from minemind.protocols.v765.bot import Bot
async def main():
async with Bot(username='Steve', host='localhost', port=25565) as bot:
await bot.chat_message('Hello, world!')
if __name__ == '__main__':
asyncio.run(main())
React to different events.
import asyncio
from minemind.dispatcher import EventDispatcher
from minemind.protocols.v765.bot import Bot
from minemind.protocols.v765.inbound.play import CollectResponse
@EventDispatcher.subscribe(CollectResponse)
async def pickup_item(data: CollectResponse):
print(f'Bot picked up {data.pickup_item_count} items')
async def main():
await Bot().run_forever()
if __name__ == '__main__':
asyncio.run(main())
Get server information.
import asyncio
from minemind.client import Client
from minemind.protocols.v765.server import Server
async def main():
async with Client(host='localhost', port=25565) as client:
server = Server(client)
print(await server.get_info())
if __name__ == '__main__':
asyncio.run(main())
Documentation
TBD
Testing
To test your bot, you can start simple local server using docker (it's using itzg/minecraft-server image):
docker-compose up
Debugging
Library provides three levels of debugging:
- [DEBUG=3] DEBUG_GAME_EVENTS: Print game events, like player movement, chat messages, damage received, etc.
- [DEBUG=2] DEBUG_PROTOCOL: Print all protocol messages, like handshaking, received events, map loading, etc. + DEBUG_GAME_EVENTS
- [DEBUG=1] DEBUG_TRACE: Lower socket level debugging, like connection status, sent and received packets, etc. + DEBUG_PROTOCOL
You can set the debug level by setting the environment variable DEBUG to one of the values above, e.g. to set debug level to DEBUG_PROTOCOL:
DEBUG=2 python my_script.py
Roadmap
- Physics engine
- Bot movement
- Elytra flight
- Combat system
- Mining
- Inventory management
- Item interaction (e.g. bed, crafting table, etc.)
- Implement crafting
- Pathfinding
- Fishing
- Documentation
- Unit-tests
- Dynamic version support
Useful links
- Minecraft protocol documentations: https://wiki.vg/Protocol_version_numbers
- Minecraft data (e.g. entities, protocol schema, etc.): https://github.com/PrismarineJS/minecraft-data/
Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Contact
If you have any questions, feel free to contact me via email: ivan@simantiev.com
Metadata
Release files for minemind 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| minemind-0.1.0.tar.gz | 144.2 kB | Without provenance | Details for minemind-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| minemind-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for minemind-0.1.0-py3-none-any.whl |
Total release size: 313.3 kB
Release files / minemind-0.1.0.tar.gz
| Download URL | minemind-0.1.0.tar.gz |
|---|---|
| Size | 144.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fafd16117a5626988429830cadec6ce3191553d8d8f1c05dc1a2aa197f66d2d3
|
|
BLAKE2b-256 checksum How to use checksums |
7eec91811ade8239157b72c18d59e42d745b3eaca9a0f27f9744dfcf81b0b753
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.11.0 Linux/6.5.0-1025-azure
|
Release files / minemind-0.1.0-py3-none-any.whl
| Download URL | minemind-0.1.0-py3-none-any.whl |
|---|---|
| Size | 169.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
645fa1dbfe1e5d9c0e115828f547bb89e7c17ec275f8d408e6f1d7d9120a2ef2
|
|
BLAKE2b-256 checksum How to use checksums |
a9b6f5d3f04b64c26b1ab27b13482a08626793775dd7e1413a61cf96044d1756
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.11.0 Linux/6.5.0-1025-azure
|
Security for minemind 0.1.0
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.