use pocketmine\entity\Attribute; use pocketmine\network\mcpe\NetworkSession; class UpdateAttributesPacket extends DataPacket{ const NETWORK_ID = ProtocolInfo::UPDATE_ATTRIBUTES_PACKET; public $entityId; /** @var Attribute[] */ public $entries = []; public function decode(){ $this->entityId = $this->getEntityRuntimeId(); $this->entries = $this->getAttributeList(); } public function encode(){ $this->reset(); $this->putEntityRuntimeId($this->entityId); $this->putAttributeList(...$this->entries); } public function handle(NetworkSession $session) : bool{ return $session->handleUpdateAttributes($this); } }