Skip to main content

PyBedrock Net

PyBedrock Net is a Python networking toolkit for building Minecraft Bedrock Edition clients, bots, server tools, and protocol experiments. It is created and maintained by ZENKAI with a focus on a clean API, simple scripts, and protocol code that can grow without becoming difficult to use.

The project is organized around the complete Bedrock client journey:

  • Client and sessions — simple client configuration, connection lifecycle, and reusable sessions.
  • RakNet and transport — UDP transport, connection handling, reliability, fragmentation, compression, and packet flow.
  • Protocol and packets — codecs, VarInts, readers, writers, registries, version resolution, handshakes, login, gameplay, movement, chat, commands, inventory, player, and world packets.
  • Authentication — offline mode plus the foundations for Microsoft/Xbox account sessions and token management.
  • World data — chunks, subchunks, palettes, blocks, cache, and world state.
  • Entities and players — entity models, metadata, tracking, and player state.
  • Bots and automation — movement, navigation, actions, and controllers.
  • Events and discovery — event dispatching, server ping, and protocol detection.

The package is intentionally built in tested layers: low-level binary primitives first, then transport and protocol packets, then high-level client and bot APIs. This makes it useful for both a quick server script and a larger Bedrock automation project.

Install

pip install pybedrock-net

The latest development work is tracked as the next package release while the published 0.3.3 page remains available at https://pypi.org/project/pybedrock-net/0.3.3/.

To create a signed login payload:

from pybedrock_net.auth import LoginChainBuilder

login = LoginChainBuilder().build(
    server_address="play.example.com:19132",
    display_name="PyBot",
)
session.begin_login(2169, login.payload())

Offline bot

For an offline-mode server, the username is selected locally and no Microsoft account is used:

from pybedrock_net.bot import BedrockBot

bot = BedrockBot("127.0.0.1", 19132, "AnyName")
bot.login(protocol=685)
bot.chat("hello")
bot.command("/say hello")

Telegram controller

The package includes a dependency-free Telegram long-polling controller:

export TELEGRAM_BOT_TOKEN="set-this-as-a-Replit-Secret"
# Optional: restrict access to comma-separated Telegram chat IDs.
export TELEGRAM_ALLOWED_CHAT_IDS="123456789"
bedrock-telegram

Send /server HOST PORT USERNAME in Telegram, then use the interactive buttons to connect, check status, send chat, send commands, or disconnect.

Command line

bedrock-ping play.example.com
bedrock-ping play.example.com --port 19132 --timeout 5

Python

from pybedrock_net import BedrockClient

client = BedrockClient("play.example.com", 19132)
status = client.ping()
print(status.description, status.players_online, "/", status.players_max)

The current release provides a real RakNet unconnected ping/pong flow, a reusable UDP transport, binary codecs, server status parsing, connected RakNet batch send/receive, Microsoft/Xbox device-code authentication, and client/bot session foundations. A signed login-chain payload is intentionally passed into ClientSession.begin_login() so applications can choose their identity provider without the library fabricating credentials.

Author

ZENKAI

Development

python -m pytest
python -m build

For local development, install the optional tooling with:

pip install -e ".[dev]"

MIT licensed.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pybedrock_net-0.5.1.tar.gz (34.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pybedrock_net-0.5.1-py3-none-any.whl (48.9 kB view details)

Uploaded Python 3

File details

Details for the file pybedrock_net-0.5.1.tar.gz.

File metadata

  • Download URL: pybedrock_net-0.5.1.tar.gz
  • Upload date:
  • Size: 34.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.11

File hashes

Hashes for pybedrock_net-0.5.1.tar.gz
Algorithm Hash digest
SHA256 8397f929d65cb15ae4b1150855ddf4150171c42e656f404a3a346107ca978fa2
MD5 361ae13b763b5d061c71ac917617f500
BLAKE2b-256 04a6753662553cbea49b504933869553ecdb9280cade0a1aa43a618335ae11c0

See more details on using hashes here.

File details

Details for the file pybedrock_net-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: pybedrock_net-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 48.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.11

File hashes

Hashes for pybedrock_net-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3515e4fc20f433afe2dd4c43b12389da61a5485fa33b8b29b4f08761af224df5
MD5 0bd1aa3943473f23acea38783a786e7e
BLAKE2b-256 f44e58e7116dbae72c10bb1ca7ae0f399ca993c65665743154e75148e98ec11a

See more details on using hashes here.

Release history Release notifications | RSS feed

0.5.2

2 files

This release

0.5.1 This release

2 files

0.5.0

2 files

0.3.6

2 files

0.3.5

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.0

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page