Skip to content

SculkCatalystMC/Protocol

Repository files navigation

📄 Protocol

C++23 CMake License

📄 中文文档

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.

💬 Community

Join our community:

  • Discord: https://discord.gg/gUQ3Pnssrx
  • QQ Group: 1063182638

✨ Highlights

  • C++23-first implementation
  • Bedrock packet abstraction via IPacket and packet factories
  • Binary serialization/deserialization primitives:
    • BinaryStream
    • ReadOnlyBinaryStream
  • CMake package export support (Protocol::Protocol)
  • MPL-2.0 licensed

🧩 Requirements

  • CMake 3.20 or newer
  • A C++23-capable compiler

🛠️ Build

📄 Configure

cmake -S . -B build -G Ninja

📄 Compile

cmake --build build

📄 Install

cmake --install build

🔌 CMake Integration

After installation, consume the library with CMake:

find_package(Protocol CONFIG REQUIRED)
target_link_libraries(your_target PRIVATE Protocol::Protocol)

🚀 Quick Start

#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;
}

🗂️ Project Layout

  • include/sculk/protocol: public headers
  • src/sculk/protocol: implementation
  • cmake: package config templates
  • scripts: development helper scripts

🧬 ABI Namespace

Public APIs are versioned with an inline ABI namespace, for example sculk::protocol::abi_v944.

🤝 Contributing

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.

🙏 Acknowledgments

This open source project was born with support from the closed-source paid project GlacieTeam/ProtocolLib.

Support link: https://afdian.tv/a/GlacieTeam

⚖️ License

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.

Copyright © 2026 SculkCatalystMC. All rights reserved.

About

An implementation of Minecraft: Bedrock Edition network protocol in C++23

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages