A C++23 Minecraft Bedrock network protocol library.
Protocol provides Bedrock packet models, packet ID mapping, and binary read/write utilities for building high-performance servers, proxies, analyzers, and protocol test suites.
Join our community:
- Discord:
https://discord.gg/gUQ3Pnssrx - QQ Group:
1063182638
- C++23-first implementation
- Bedrock packet abstraction via
IPacketand packet factories - Binary serialization/deserialization primitives:
BinaryStreamReadOnlyBinaryStream
- CMake package export support (
Protocol::Protocol) - MPL-2.0 licensed
- CMake 3.20 or newer
- A C++23-capable compiler
cmake -S . -B build -G Ninjacmake --build buildcmake --install buildAfter installation, consume the library with CMake:
find_package(Protocol CONFIG REQUIRED)
target_link_libraries(your_target PRIVATE Protocol::Protocol)#include <sculk/protocol/MinecraftPackets.hpp>
#include <sculk/protocol/packet/IPacket.hpp>
#include <sculk/protocol/utility/BinaryStream.hpp>
#include <sculk/protocol/utility/ReadOnlyBinaryStream.hpp>
#include <cstddef>
#include <vector>
int main() {
using namespace sculk::protocol;
// Example input from network transport.
std::vector<std::byte> input{};
ReadOnlyBinaryStream readStream{input};
const auto header = MinecraftPackets::readPacketHeader(readStream);
auto packet = MinecraftPackets::createPacket(header);
if (packet) {
const auto readResult = packet->readNoHeader(readStream);
if (!readResult) {
return 1;
}
std::vector<std::byte> output;
BinaryStream writeStream{output};
packet->writeWithHeader(writeStream);
}
return 0;
}include/sculk/protocol: public headerssrc/sculk/protocol: implementationcmake: package config templatesscripts: development helper scripts
Public APIs are versioned with an inline ABI namespace,
for example sculk::protocol::abi_v944.
Contributions are welcome.
- Open an Issue for bug reports, feature requests, or protocol discussions.
- Open a Pull Request for fixes, improvements, and new packet support.
- Keep changes focused and provide clear descriptions of behavior changes.
This open source project was born with support from the closed-source paid project GlacieTeam/ProtocolLib.
Support link: https://afdian.tv/a/GlacieTeam
This project is licensed under the Mozilla Public License 2.0 (MPL-2.0). See the full text in LICENSE.
Core MPL-2.0 requirements (summary):
- If you modify MPL-covered files and distribute them, those modified files must remain under MPL-2.0.
- You must keep existing copyright and license notices in covered source files.
- If you distribute binaries/executables, you must make the corresponding covered source code available.
- You may combine this project with code under other licenses in a larger work, as long as MPL obligations for covered files are respected.
This summary is for convenience only. The LICENSE file is the authoritative legal text.