minemind


Nameminemind JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummaryLow-level API for creating minecraft bots
upload_time2024-10-09 22:33:49
maintainerNone
docs_urlNone
authoriYasha
requires_python<4.0,>=3.11
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # MineMind

Low-level API for creating minecraft bots.


## Supported Versions

- 1.20.3

## Installation

```bash
pip install minemind
```

## Example

Say hello world to the server.

````python
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.

````python
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.

````python
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):
```bash
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`:
```bash
DEBUG=2 python my_script.py
```

## Roadmap

- [x] 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!

1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

## Contact
If you have any questions, feel free to contact me via email: [ivan@simantiev.com](mailto:ivan@simantiev.com)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "minemind",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.11",
    "maintainer_email": null,
    "keywords": null,
    "author": "iYasha",
    "author_email": "33287747+iYasha@users.noreply.github.com",
    "download_url": "https://files.pythonhosted.org/packages/7e/ec/91811ade8239157b72c18d59e42d745b3eaca9a0f27f9744dfcf81b0b753/minemind-0.1.0.tar.gz",
    "platform": null,
    "description": "# MineMind\n\nLow-level API for creating minecraft bots.\n\n\n## Supported Versions\n\n- 1.20.3\n\n## Installation\n\n```bash\npip install minemind\n```\n\n## Example\n\nSay hello world to the server.\n\n````python\nimport asyncio\nfrom minemind.protocols.v765.bot import Bot\n\n\nasync def main():\n    async with Bot(username='Steve', host='localhost', port=25565) as bot:\n        await bot.chat_message('Hello, world!')\n\n\nif __name__ == '__main__':\n    asyncio.run(main())\n````\n\nReact to different events.\n\n````python\nimport asyncio\nfrom minemind.dispatcher import EventDispatcher\nfrom minemind.protocols.v765.bot import Bot\nfrom minemind.protocols.v765.inbound.play import CollectResponse\n\n\n@EventDispatcher.subscribe(CollectResponse)\nasync def pickup_item(data: CollectResponse):\n    print(f'Bot picked up {data.pickup_item_count} items')\n\n\nasync def main():\n    await Bot().run_forever()\n\n\nif __name__ == '__main__':\n    asyncio.run(main())\n````\n\nGet server information.\n\n````python\nimport asyncio\n\nfrom minemind.client import Client\nfrom minemind.protocols.v765.server import Server\n\n\nasync def main():\n    async with Client(host='localhost', port=25565) as client:\n        server = Server(client)\n        print(await server.get_info())\n\n\nif __name__ == '__main__':\n    asyncio.run(main())\n````\n\n## Documentation\nTBD\n\n### Testing\nTo test your bot, you can start simple local server using docker (it's using itzg/minecraft-server image):\n```bash\ndocker-compose up\n````\n\n### Debugging\nLibrary provides three levels of debugging:\n- [DEBUG=3] DEBUG_GAME_EVENTS: Print game events, like player movement, chat messages, damage received, etc.\n- [DEBUG=2] DEBUG_PROTOCOL: Print all protocol messages, like handshaking, received events, map loading, etc. + DEBUG_GAME_EVENTS\n- [DEBUG=1] DEBUG_TRACE: Lower socket level debugging, like connection status, sent and received packets, etc. + DEBUG_PROTOCOL\n\nYou 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`:\n```bash\nDEBUG=2 python my_script.py\n```\n\n## Roadmap\n\n- [x] Physics engine\n- [ ] Bot movement\n- [ ] Elytra flight\n- [ ] Combat system\n- [ ] Mining\n- [ ] Inventory management\n- [ ] Item interaction (e.g. bed, crafting table, etc.)\n- [ ] Implement crafting\n- [ ] Pathfinding\n- [ ] Fishing\n- [ ] Documentation\n- [ ] Unit-tests\n- [ ] Dynamic version support\n\n## Useful links\n\n- Minecraft protocol documentations: https://wiki.vg/Protocol_version_numbers \n- Minecraft data (e.g. entities, protocol schema, etc.): https://github.com/PrismarineJS/minecraft-data/\n\n## Contributing\nContributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\nIf 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\".\nDon't forget to give the project a star! Thanks again!\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n## Contact\nIf you have any questions, feel free to contact me via email: [ivan@simantiev.com](mailto:ivan@simantiev.com)\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Low-level API for creating minecraft bots",
    "version": "0.1.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a9b6f5d3f04b64c26b1ab27b13482a08626793775dd7e1413a61cf96044d1756",
                "md5": "f45052abd4d7aff921bfa0e19d4ddb1e",
                "sha256": "645fa1dbfe1e5d9c0e115828f547bb89e7c17ec275f8d408e6f1d7d9120a2ef2"
            },
            "downloads": -1,
            "filename": "minemind-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f45052abd4d7aff921bfa0e19d4ddb1e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.11",
            "size": 169190,
            "upload_time": "2024-10-09T22:33:47",
            "upload_time_iso_8601": "2024-10-09T22:33:47.449808Z",
            "url": "https://files.pythonhosted.org/packages/a9/b6/f5d3f04b64c26b1ab27b13482a08626793775dd7e1413a61cf96044d1756/minemind-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7eec91811ade8239157b72c18d59e42d745b3eaca9a0f27f9744dfcf81b0b753",
                "md5": "aea3c39def35d7381626b3408ed449f8",
                "sha256": "fafd16117a5626988429830cadec6ce3191553d8d8f1c05dc1a2aa197f66d2d3"
            },
            "downloads": -1,
            "filename": "minemind-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "aea3c39def35d7381626b3408ed449f8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.11",
            "size": 144156,
            "upload_time": "2024-10-09T22:33:49",
            "upload_time_iso_8601": "2024-10-09T22:33:49.672796Z",
            "url": "https://files.pythonhosted.org/packages/7e/ec/91811ade8239157b72c18d59e42d745b3eaca9a0f27f9744dfcf81b0b753/minemind-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-09 22:33:49",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "minemind"
}
        
Elapsed time: 0.36802s