Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alemidev/aiocraft
asyncio-driven headless client library for block game
https://github.com/alemidev/aiocraft
async codegen minecraft protocol python
Last synced: 25 days ago
JSON representation
asyncio-driven headless client library for block game
- Host: GitHub
- URL: https://github.com/alemidev/aiocraft
- Owner: alemidev
- License: mit
- Created: 2021-09-30T15:05:53.000Z (about 3 years ago)
- Default Branch: dev
- Last Pushed: 2024-04-18T15:38:08.000Z (7 months ago)
- Last Synced: 2024-04-18T15:44:32.919Z (7 months ago)
- Topics: async, codegen, minecraft, protocol, python
- Language: Python
- Homepage:
- Size: 570 KB
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# aiocraft
**an asyncio-driven headless client library for block game with packet definitions**aiocraft is a collection of types, definitions and utils to build minecraft clients without the official Java implementation
it is built on top of [PrismarineJS/minecraft-data](https://github.com/PrismarineJS/minecraft-data), which contains definitions for all types across all versions
aiocraft provides a raw implementation of a client but it isn't ready to be used, if you're looking for a convenient client library take a look at **[Treepuncher](https://git.alemi.dev/treepuncher.git/about)**
## Packets
the whole Minecraft protocol from `0.30c` to `1.19.3` is compiled and available
feature flags to only include certain protocol versions are planned
all types and packets are instantiable and serializable on all supported protocols:
```py
from aiocraft.proto.play.serverbound import PacketPositiona_packet = PacketPosition(x=-4.0, y=64.0, z=10.5, onGround=True)
await client.dispatcher.write(a_packet)
```## Client
an abstract client implementation is provided, but it's supposed to be extended (like in **[Treepuncher](https://git.alemi.dev/treepuncher.git/about)**)
the abstract client implements flows for all game phases and both a `.join()` or a `.info()` method to easily start the login flow## Types
aiocraft defines these minecraft types:* `Dimension`
* `Difficulty`
* `Gamemode`
* `GameProfile`
* `Enchantment`
* `BlockPos`
* `Item` (without constants)
* `Texture`
* `Player`more types are planned but still not generated:
* `Entity`
* `Block`
* `Item` (with constants)## World
a chunk parser is provided with native code (Rust + PyO3). It is pretty fast but the abstract client doesn't make use of it