Metadata-Version: 2.4
Name: pybedrockbot
Version: 0.2.0
Summary: Pure Python Minecraft Bedrock Edition bot and networking library
Home-page: https://github.com/PyBedrockBot/pybedrockbot
Author: PyBedrockBot Contributors
License: MIT
Project-URL: Homepage, https://github.com/PyBedrockBot/pybedrockbot
Project-URL: Repository, https://github.com/PyBedrockBot/pybedrockbot
Keywords: minecraft,bedrock,bot,raknet,mcbe,protocol
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Games/Entertainment
Classifier: Topic :: Internet
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: cryptography>=41.0.0
Requires-Dist: pyjwt>=2.8.0
Dynamic: home-page
Dynamic: requires-python

PyBedrockBot
============

Pure Python Minecraft Bedrock Edition bot and networking library.
Supports protocol 766 (Bedrock 1.21.x), ECDH AES-256 CTR encryption, RakNet UDP, and authoritative movement.

Features
--------

- Pure Python: No Node.js or external runtime dependencies.
- Minecraft Bedrock 1.21.x support (Protocol 766).
- Full authentication cycle (Identity chain, client data, custom skin JWT).
- End-to-end session encryption (ECDH SECP384R1, AES-256-CTR, SHA-256 checksum).
- Custom RakNet UDP implementation with split packet reassembly and ACK/NACK handling.
- Authoritative physics tick loop (20 TPS) sending PlayerAuthInputPacket and MovePlayerPacket.
- Event-driven API (on_connect, on_ready, on_spawn, on_chat, on_message, on_move, on_disconnect, on_error).
- Chat and slash command execution support.

Installation
------------

```bash
pip install pybedrockbot
```

Quickstart
----------

```python
from pybedrockbot import BedrockBot

bot = BedrockBot(host='127.0.0.1', port=19132, username='MyBot')

@bot.event
def on_ready():
    print(f'Bot {bot.username} spawned at ({bot.x}, {bot.y}, {bot.z})')
    bot.chat('Hello from Python!')

@bot.event
def on_chat(sender: str, message: str):
    print(f'[{sender}]: {message}')
    if message == '!ping':
        bot.chat(f'@{sender} pong!')

@bot.event
def on_disconnect(reason: str):
    print(f'Disconnected: {reason}')

if __name__ == '__main__':
    bot.run()
```

API Reference
-------------

Bot Methods:
- bot.chat(message) - Sends a chat message.
- bot.command(cmd) - Sends a server slash command.
- bot.walk_forward(distance=1.0) - Moves forward in facing direction.
- bot.walk_backward(distance=1.0) - Moves backward.
- bot.strafe_left(distance=1.0) - Strafes left.
- bot.strafe_right(distance=1.0) - Strafes right.
- bot.jump() - Performs a jump.
- bot.sneak(enabled=True) - Toggles sneaking state.
- bot.sprint(enabled=True) - Toggles sprinting state.
- bot.look(pitch, yaw) - Sets rotation angles.
- bot.look_at(x, y, z) - Points gaze at specific 3D coordinates.
- bot.set_position(x, y, z) - Sets target position coordinates.
- bot.disconnect(reason) - Gracefully disconnects from server.
- bot.run() - Starts blocking event loop.
- bot.run_async() - Coroutine for existing asyncio event loop.

License
-------

MIT License
