Skip to main content

bedrock-protocol

The Minecraft: Bedrock Edition network protocol for C++, Python and Java

CI License

Python

Install

Install the Linux or Windows wheel for Python 3.12 or newer from PyPI:

uv pip install bedrock-protocol

Or build it from a checkout with CMake and a C++23 compiler:

git clone https://github.com/EndstoneMC/bedrock-protocol
uv pip install ./bedrock-protocol

Encode and decode

import bedrock_protocol as bp

packet = bp.TextPacket()
packet.body = bp.TextPacket.MessageOnly(type=bp.TextPacketType.CHAT, message="hello")
data = bp.encode(packet)
decoded = bp.decode(bp.TextPacket, data)
assert decoded == packet

Pick a protocol

version = bp.ProtocolVersion.get(2259)
assert version is not None and version.name == "1.26.70"

pinned = bp.v2259.encode(packet)
picked = bp.v2259.decode(bp.TextPacket, pinned)
assert picked == packet

C++

Install

Unpack a package from the releases and point CMAKE_PREFIX_PATH at its folder:

find_package(bedrock-protocol CONFIG REQUIRED)
target_link_libraries(my_target PRIVATE bedrock::protocol)

Encode and decode

#include <cassert>

#include <bedrock/protocol.hpp>

namespace bp = bedrock::protocol;

bp::TextPacket packet;
packet.body = bp::TextPacket::MessageOnly{.type = bp::TextPacketType::Chat, .message = "hello"};

std::expected<std::string, bp::EncodeError> data = bp::encode(packet);
assert(data);
std::expected<bp::TextPacket, bp::DecodeError> decoded = bp::decode<bp::TextPacket>(*data);
assert(decoded && *decoded == packet);

Pick a protocol

std::optional<bp::ProtocolVersion> version = bp::ProtocolVersion::get(2259);
assert(version && version->getName() == "1.26.70");

std::expected<std::string, bp::EncodeError> pinned = bp::v2259::encode(packet);
assert(pinned);
std::expected<bp::TextPacket, bp::DecodeError> picked = bp::v2259::decode<bp::TextPacket>(*pinned);
assert(picked && *picked == packet);

Java

Install

Add the package from Maven Central to a Gradle build:

dependencies {
    implementation("dev.endstone:bedrock-protocol:X.Y.Z")
}

Or build it from a checkout with JDK 21 and Python 3.12 or newer into the local Maven repository:

git clone https://github.com/EndstoneMC/bedrock-protocol
cd bedrock-protocol/java
./gradlew publishToMavenLocal

Encode and decode

import dev.endstone.protocol.Protocol;
import dev.endstone.protocol.TextPacket;
import dev.endstone.protocol.TextPacketType;

TextPacket packet =
        TextPacket.newBuilder()
                .setMessageOnly(
                        TextPacket.MessageOnly.newBuilder()
                                .setType(TextPacketType.CHAT)
                                .setMessage("hello")
                                .build())
                .build();

byte[] data = Protocol.encode(packet);
TextPacket decoded = Protocol.decode(TextPacket.class, data);
assert decoded.equals(packet);

Pick a protocol

import dev.endstone.protocol.ProtocolVersion;

import java.util.Optional;

Optional<ProtocolVersion> version = ProtocolVersion.get(2259);
assert version.isPresent() && version.get().getName().equals("1.26.70");

byte[] pinned = Protocol.v2259.encode(packet);
TextPacket picked = Protocol.v2259.decode(TextPacket.class, pinned);
assert picked.equals(packet);

Supported Protocols

Protocol Releases
712 1.21.20 to 1.21.23
729 1.21.30 to 1.21.31
748 1.21.40 to 1.21.44
766 1.21.50 to 1.21.51
776 1.21.60 to 1.21.62
786 1.21.70 to 1.21.73
800 1.21.80 to 1.21.84
818 1.21.90 to 1.21.92
819 1.21.93 to 1.21.95
827 1.21.100 to 1.21.102
844 1.21.111 to 1.21.114
859 1.21.120 to 1.21.123
860 1.21.124
898 1.21.130 to 1.21.132
924 1.26.0 to 1.26.3
944 1.26.10 to 1.26.14
975 1.26.20 to 1.26.23
1001 1.26.30 to 1.26.36
2168 1.26.40 to 1.26.44
2169 1.26.45
2193 1.26.50 to 1.26.52
2225 1.26.60 to 1.26.66
2259 1.26.7x

Building from Source

With CMake, Ninja, Python 3.12 or newer and a C++23 compiler, from a Visual Studio developer prompt on Windows:

cmake --preset release
cmake --build --preset release
cmake --install build/Release --prefix stage
uv sync

License

MIT, see LICENSE.

Metadata

Release files for bedrock-protocol 0.5.1

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

Source distribution (sdist)

Source distribution for bedrock-protocol 0.5.1
File Size Uploaded Provenance Actions
bedrock_protocol-0.5.1.tar.gz 338.7 kB With provenance Details for bedrock_protocol-0.5.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for bedrock-protocol 0.5.1
File Interpreter ABI Platform Actions
bedrock_protocol-0.5.1-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details for bedrock_protocol-0.5.1-cp312-abi3-win_amd64.whl
bedrock_protocol-0.5.1-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 abi3 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for bedrock_protocol-0.5.1-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Total release size: 12.5 MB

Release files / bedrock_protocol-0.5.1.tar.gz

Download URL bedrock_protocol-0.5.1.tar.gz
Size 338.7 kB
Tags Source
SHA-256 checksum
How to use checksums
06ef32f76062e7f4de347a69f36be00e9c2995ee34cd61265603bd50e84127ef
BLAKE2b-256 checksum
How to use checksums
c0472b058fdb4f7a71d19b2a2512621a3efb9d7f8420064dea365c3e4fc0e3a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / bedrock_protocol-0.5.1-cp312-abi3-win_amd64.whl

Download URL bedrock_protocol-0.5.1-cp312-abi3-win_amd64.whl
Size 5.1 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
7cf521ed21cb86acdf743182ef6058d55981a588361e0c912afb764975ace582
BLAKE2b-256 checksum
How to use checksums
3bb598412d3786381d68b89c3e3de219e1b6592f742670f0d5d0def6b140d67a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / bedrock_protocol-0.5.1-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL bedrock_protocol-0.5.1-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 7.0 MB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
9d21ef0f5362a53f4e274f45443288d7eaf970ad4ead7f05187d7f4afc56a19d
BLAKE2b-256 checksum
How to use checksums
083d57ccc776b6499c4a3c739b66f99a67f03162a6c9515672c0094fe5cc95f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Security for bedrock-protocol 0.5.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 3 files in this release have been uploaded with provenance metadata.

Select from 3 files

Attestation for bedrock_protocol-0.5.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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