use pocketmine\item\Item; use pocketmine\network\mcpe\NetworkSession; class MobArmorEquipmentPacket extends DataPacket{ public const NETWORK_ID = ProtocolInfo::MOB_ARMOR_EQUIPMENT_PACKET; /** @var int */ public $entityRuntimeId; /** @var Item[] */ public $slots = []; protected function decodePayload(){ $this->entityRuntimeId = $this->getEntityRuntimeId(); for($i = 0; $i < 4; ++$i){ $this->slots[$i] = $this->getSlot(); } } protected function encodePayload(){ $this->putEntityRuntimeId($this->entityRuntimeId); for($i = 0; $i < 4; ++$i){ $this->putSlot($this->slots[$i]); } } public function handle(NetworkSession $session) : bool{ return $session->handleMobArmorEquipment($this); } }