Skip to content

Instantly share code, notes, and snippets.

View dktapps's full-sized avatar

Dylan T. dktapps

View GitHub Profile
@dktapps
dktapps / README.md
Last active February 6, 2026 03:39
Minecraft PE Android crashdump decoder script

Minecraft PE crashdump decoder

Setting up environment

Install depot_tools and make sure the tools are available in your PATH variable. You might need to add them to your path manually.

Getting a crashdump file

Requirements:

  • A rooted Android device with MCPE installed.
  1. Trigger the crash you want to debug. When your game crashes, DON'T RESTART IT.
@dktapps
dktapps / luckperms-demo-command-tree.php
Last active November 11, 2025 20:39
Demo of how a command tree for LuckPerms would be implemented using https://github.com/pmmp/PocketMine-MP/pull/6837 (not final)
<?php
declare(strict_types=1);
namespace dktapps\test;
use pocketmine\command\Command;
use pocketmine\command\CommandSender;
use pocketmine\command\overload\IntRangeParameter;
use pocketmine\command\overload\OverloadBuilder;
@dktapps
dktapps / mapMatrixFlattened.php
Created August 18, 2025 19:35
Proof of concept for a cursed hack for Minecraft flattened blocks in PocketMine-MP, based on `unify-block-serializers` branch
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
@dktapps
dktapps / 5.0.md
Last active May 31, 2023 17:34
Draft of PM 5.0.0 changelog

For Minecraft: Bedrock Edition 1.19.80

5.0.0 is a major update to PocketMine-MP, including many new features and API changes. It is not compatible with plugins written for previous versions of PocketMine-MP.

5.0.0

Released 1st June 2023.

Core

  • Worlds are now saved according to the Bedrock 1.19.80 format.
@dktapps
dktapps / README.md
Last active February 15, 2023 13:56
Packet handler used to generate most of BedrockData for PocketMine-MP (PM3 only)

This script operates on a packet dump between a vanilla client and server.

A dump like this can be obtained in various ways - a proxy, my frida tracer, etc. However you get it, the file provided should have one packet per line, starting with read: or write: and ending with a base64-encoded packet (including the packet ID).

A quick example grabbed from one of my old log files:

read:kAHwoMpB4PUgQQAAAD8g17NAAAAAPwAAAAAAAAAA4PUgQQABAg==
write:CQ==
write:CQIBG8KnZSVtdWx0aXBsYXllci5wbGF5ZXIubGVmdAELbWN0ZXN0RHlsYW4AAA==
@dktapps
dktapps / run.php
Last active February 15, 2023 04:52
A basic UDP proxy used to bypass client-side Xbox Live authentication in MCPE 1.2.
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
@dktapps
dktapps / enable_strict_types.php
Created June 7, 2017 13:38
Hacked-together script to enable strict types in PHP files en masse. Primarily intended for PocketMine-MP.
<?php
declare(strict_types=1);
$startTime = microtime(true);
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(__DIR__ . DIRECTORY_SEPARATOR));
foreach($iterator as $file){
if($file->getExtension() === "php"){
$path = $file->getPath() . DIRECTORY_SEPARATOR . $file->getFilename();
TAG_Compound={
"BiomeOverride" => TAG_String=""
"CenterMapsToOrigin" => TAG_Byte=0
"ConfirmedPlatformLockedContent" => TAG_Byte=0
"Difficulty" => TAG_Int=0
"FlatWorldLayers" => TAG_String="{"biome_id":1,"block_layers":[{"block_name":"minecraft:bedrock","count":1},{"block_name":"minecraft:dirt","count":2},{"block_name":"minecraft:grass","count":1}],"encoding_version":6,"structure_options":null,"world_version":"version.post_1_18"}
"
"ForceGameType" => TAG_Byte=0
"GameType" => TAG_Int=1
"Generator" => TAG_Int=1
<?php
namespace test;
use function hrtime;
use function printf;
class BinaryStream{
protected string $buffer = "";

Deserializing old items in world saves

Classic items (MCPE <= 1.5, PM <= 1.12)

  1. int ID + meta
  2. 1.16 string ID via item_id_map.json -> string ID + meta
  3. deserialize as medieval item

Medieval items (MCPE 1.6 - 1.8)