• Stars
    star
    130
  • Rank 277,575 (Top 6 %)
  • Language
    PHP
  • License
    GNU Lesser Genera...
  • Created over 3 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An implementation of the Minecraft: Bedrock Edition protocol in PHP

BedrockProtocol

CI

An implementation of the Minecraft: Bedrock Edition protocol in PHP

This library implements all of the packets in the Minecraft: Bedrock Edition protocol, as well as a few extra things needed to support them. However, at the time of writing, it does not include the following:

  • Anything related to JWT handling/verification
  • Anything related to encryption
  • Anything related to compression

Decoding packets

Assuming you've decrypted and decompressed a Minecraft packet successfully, you're next going to want to decode it. With this library, that's currently done using PacketBatch, like so:

foreach(PacketBatchUtils::decodePackets(new BinaryStream($payload), $protocolContext, PacketPool::getInstance()) as $packetObject){
    var_dump($packetObject); //tada
}

Encoding packets

This is easy:

/** @var Packet[] $packets */
$stream = new BinaryStream();
PacketBatchUtils::encodePackets($stream, $protocolContext, $packets);
$batchPayload = $stream->getBuffer();

Footnotes

This library is a little rough around the edges, since it's only ever been intended for PocketMine-MP usage. It's only recently that this mess has been separated from the core to allow it to be used by other things. This means that API changes might be in order, and your feedback would be nice to drive them. If you want to improve BedrockProtocol, please open issues with suggestions, or better, make pull requests.

More Repositories

1

PocketMine-MP

A server software for Minecraft: Bedrock Edition in PHP
PHP
3,247
star
2

PHP-Binaries

Compile scripts used to build PHP for PocketMine-MP on multiple platforms
Shell
116
star
3

DevTools

Development tools plugin for PocketMine-MP
PHP
104
star
4

BedrockData

Blobs of data generated from Minecraft: Bedrock Edition used by PocketMine-MP
PHP
94
star
5

RakLib

RakNet server implementation written in PHP
PHP
84
star
6

ext-pmmpthread

Fork of https://github.com/krakjoe/pthreads with a revamped API and PHP 8.1+ support
C
82
star
7

Math

PHP library containing math related code used in PocketMine-MP
PHP
41
star
8

NBT

PHP library for working with the NBT (Named Binary Tag) data storage format, as designed by Mojang.
PHP
40
star
9

DeveloperDocs

Documentation for PocketMine-MP plugin developers
HTML
37
star
10

ext-chunkutils2

PHP extension in C++ implementing performance-sensitive parts of the PocketMine-MP chunk system
C++
31
star
11

bds-modding-devkit

Auxiliary scripts used for modding BDS for generating protocol data
Shell
31
star
12

RegisterBlocksDemoPM5

Demo plugin showing how to add missing vanilla (not custom) blocks to PM5
PHP
30
star
13

BinaryUtils

PHP library containing classes and methods for conveniently handling binary strings
PHP
24
star
14

PocketMine-Docker

Hosts the files used to build pmmp/pocketmine-mp Docker image
PHP
24
star
15

Language

Language files for PocketMine-MP
22
star
16

ext-encoding

High-performance `ByteBuffer` implementation for PHP, planned for use in a future version of PocketMine-MP
C++
21
star
17

PocketMine-C-ChunkUtils

PHP C extension implementing some chunk conversion methods for PocketMine-MP
PHP
21
star
18

RconServer

Control your PocketMine-MP server remotely using RCON tools
PHP
19
star
19

SessionsDemo

Demo plugin showing how to manage plugin player data at runtime (without custom Player classes)
PHP
19
star
20

AntiInstaBreak

PocketMine-MP plugin implementing instabreak anti-cheat which was originally built-in.
PHP
19
star
21

Snooze

Event loop for handling notifications from multiple threads at once
PHP
16
star
22

BedrockBlockPaletteArchive

Archive of previous Minecraft Bedrock block palettes of interest, useful for world format upgrading
15
star
23

BedrockBlockUpgradeSchema

(Mostly) auto-generated schemas for upgrading blockstates found in older Minecraft: Bedrock worlds
15
star
24

extension-stub-generator

Generates stubs for extension classes, constants, functions and more. Useful for autocomplete in IDEs.
PHP
13
star
25

SPL

[deprecated] Miscellaneous PHP library files required by PocketMine-MP and related projects
PHP
13
star
26

doc.pmmp.io

Documentation for PocketMine-MP
Python
13
star
27

CrashArchive

Web-based searchable archive for PocketMine-MP crash reports
Go
12
star
28

BedrockProtocolDumper

Generate basic information about new protocol versions from BDS using Python and GNU objdump
Python
12
star
29

bds-mod-saveallchunks

Mod for BDS to force it to save all chunks, useful for exporting vanilla maps for custom server use
CMake
12
star
30

ext-libdeflate

PHP bindings for libdeflate, a zlib replacement with significantly better performance.
C
11
star
31

ext-morton

PHP bindings for libmorton C++ library
C++
9
star
32

PreProcessor

[deprecated] Scripts used to optimise PocketMine-MP before building phars
C++
8
star
33

setup-php-action

GitHub Action to setup PHP binaries with extensions needed by PocketMine-MP
TypeScript
8
star
34

pmmp.io

The Website.
JavaScript
7
star
35

BedrockItemUpgradeSchema

JSON schemas for upgrading items saved on older Minecraft: Bedrock world saves
7
star
36

ext-xxhash

High-performance PHP binding for xxhash https://github.com/Cyan4973/xxHash
C
6
star
37

pocketmine-helm

Helm chart to deploy PocketMine-MP with plugins on Kubernetes
Go
6
star
38

ext-arraydebug

Debug functions for PHP arrays to calculate things like hash distribution and other internal information
C
6
star
39

UUID

Stepping-stone of PM 4.0 development. Abandoned, retained for historic purposes only.
PHP
6
star
40

get.pmmp.io

Source code for https://get.pmmp.io
Shell
5
star
41

setup-action

GitHub action for setting up the environment for PocketMine
TypeScript
5
star
42

ErrorHandler

Basic utilities to make nasty PHP E_* errors more usable
PHP
4
star
43

DataModels

JSON schema models and generated code to validate and handle various data in PocketMine-MP
PHP
4
star
44

BasicSpawnProtection

Basic vanilla-like spawn protection for PocketMine-MP
PHP
4
star
45

RakLibIpc

Channel-based inter-thread/inter-process communication protocol library for RakLib
PHP
3
star
46

ext-recursionguard

Lightweight PHP extension to hard-cap function call depth.
C
3
star
47

PcntlSignalHandler

[deprecated] PocketMine-MP plugin to allow stopping the server gracefully using CTRL+C
PHP
3
star
48

Log

Logging components used by PocketMine-MP and related projects
PHP
3
star
49

registry.pmmp.io

Plugin registry API server
TypeScript
2
star
50

DependencyMirror

Mirrors of packages needed by PHP-Binaries build
2
star
51

CodeStyle

Pocketmine's style rules, including custom rules.
PHP
2
star
52

Color

Color handling library used by PocketMine-MP and related projects
PHP
2
star
53

update.pmmp.io

Artifacts used by https://get.pmmp.io and https://update.pmmp.io/api
PHP
1
star
54

CompatibilityDataPM4

Backwards-compatibility resource files needed by PocketMine-MP 4.x
1
star
55

LogPthreads

[deprecated] pthreads-specific logging components used by PocketMine-MP and related projects
PHP
1
star