Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View dktapps's full-sized avatar

Dylan T. dktapps

View GitHub Profile
@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)

@dktapps
dktapps / 9999_chunker.app_fixes.json
Created May 30, 2022 19:23
BlockState Upgrader schema for fixing worlds converted by https://chunker.app
{
"maxVersionMajor": 255,
"maxVersionMinor": 255,
"maxVersionPatch": 255,
"maxVersionRevision": 255,
"addedProperties": {
"minecraft:anvil": {
"damage": {
"string": "undamaged"
}
@dktapps
dktapps / hardness_table.json
Created January 16, 2022 02:20
Table of all block hardness in Bedrock as of Minecraft Bedrock 1.18.0
{
"minecraft:acacia_button": 0.5,
"minecraft:acacia_door": 3.0,
"minecraft:acacia_fence_gate": 2.0,
"minecraft:acacia_pressure_plate": 0.5,
"minecraft:acacia_stairs": 2.0,
"minecraft:acacia_standing_sign": 1.0,
"minecraft:acacia_trapdoor": 3.0,
"minecraft:acacia_wall_sign": 1.0,
"minecraft:activator_rail": 0.5,

PocketMine-MP Core Permissions

Generated from PocketMine-MP 4.0.0-BETA6+dev

Name Description Implied permissions
pocketmine.broadcast.admin Allows the user to receive administrative broadcasts N/A
pocketmine.broadcast.user Allows the user to receive user broadcasts N/A
pocketmine.command.ban.ip Allows the user to ban IP addresses N/A
pocketmine.command.ban.list Allows the user to list banned players N/A
pocketmine.command.ban.player Allows the user to ban players N/A