use pocketmine\network\mcpe\NetworkSession; use pocketmine\network\mcpe\protocol\types\inventory\ItemStackWrapper; class MobArmorEquipmentPacket extends DataPacket{ public const NETWORK_ID = ProtocolInfo::MOB_ARMOR_EQUIPMENT_PACKET; /** @var int */ public $entityRuntimeId; //this intentionally doesn't use an array because we don't want any implicit dependencies on internal order /** @var ItemStackWrapper */ public $head; /** @var ItemStackWrapper */ public $chest; /** @var ItemStackWrapper */ public $legs; /** @var ItemStackWrapper */ public $feet; protected function decodePayload(){ $this->entityRuntimeId = $this->getEntityRuntimeId(); $this->head = ItemStackWrapper::read($this); $this->chest = ItemStackWrapper::read($this); $this->legs = ItemStackWrapper::read($this); $this->feet = ItemStackWrapper::read($this); } protected function encodePayload(){ $this->putEntityRuntimeId($this->entityRuntimeId); $this->head->write($this); $this->chest->write($this); $this->legs->write($this); $this->feet->write($this); } public function handle(NetworkSession $session) : bool{ return $session->handleMobArmorEquipment($this); } }