From bec37f62f8dafc2f8454a0b3cd418aee1e6b0a9b Mon Sep 17 00:00:00 2001 From: yefengeeeeeeeeeee <403749250@qq.com> Date: Sun, 12 Jul 2026 22:10:32 +0800 Subject: [PATCH] WIP: HurtArmor for MCPE 0.6.1 --- src/entity/Entity.php | 5 +++++ src/recipes/CraftingRecipes.php | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/entity/Entity.php b/src/entity/Entity.php index 7ba9fc89..6d8e2821 100644 --- a/src/entity/Entity.php +++ b/src/entity/Entity.php @@ -1634,6 +1634,11 @@ class Entity extends Position $part->hurtAndBreak($v2, $this->player, helditem: false); if($part->count <= 0) $this->player->setArmor($slot, BlockAPI::getItem(0, 0, 0), send: false); } + if($this->player->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_11 && $this->player->PROTOCOL > ProtocolInfo8::CURRENT_PROTOCOL_8){ + $pk = new HurtArmorPacket(); + $pk->health = $part->meta - $v2; + //$this->player->dataPacket($pk); //MCPE 0.6.0 + } $this->player->sendArmor(); } } diff --git a/src/recipes/CraftingRecipes.php b/src/recipes/CraftingRecipes.php index e84816de..c0c8c525 100644 --- a/src/recipes/CraftingRecipes.php +++ b/src/recipes/CraftingRecipes.php @@ -938,7 +938,6 @@ class CraftingRecipes{ return true; //recipe might be found next time } if($protocol <= ProtocolInfo12::CURRENT_PROTOCOL_12 && $protocol >= ProtocolInfo12::CURRENT_PROTOCOL_11 && ($craftIndex === "5:0x4" || $craftIndex === "53:0x4" || $craftIndex === "158:0x6")){ - console(2); switch ($craftIndex){ case "5:0x4": $arr[$craftIndex][][] = [WOOD, "?", 1];