Skip to main content

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

pip install pybedrockbot

Quickstart

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

Metadata

Release files for pybedrockbot 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pybedrockbot 0.2.0
File Size Uploaded
pybedrockbot-0.2.0.tar.gz 22.0 kB Details

Built distribution (wheel)

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

Total release size: 50.4 kB

Release files / pybedrockbot-0.2.0.tar.gz

Download URL pybedrockbot-0.2.0.tar.gz
Size 22.0 kB
Tags Source
SHA-256 checksum
How to use checksums
edfcd2422feef7aa0d49fb0d381381df9ad3036e3d1f6fcc16b5f27c0177de03
BLAKE2b-256 checksum
How to use checksums
2a39dca02a0e6382ad6f7bdf4360d859f0d9f4e2d09fbb2d44e56226a34fb3bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.11

Release files / pybedrockbot-0.2.0-py3-none-any.whl

Download URL pybedrockbot-0.2.0-py3-none-any.whl
Size 28.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
29ca269c3b9c7873b4c6383d79437688d094ac2fb7187454800a0072a3e6ce43
BLAKE2b-256 checksum
How to use checksums
3ac0b44fe595043e76ed7712b3ae50f415f06121f9df1d1e08ba5adee1d40dc5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.11

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

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