use pocketmine\network\mcpe\NetworkSession; class SetEntityLinkPacket extends DataPacket{ const NETWORK_ID = ProtocolInfo::SET_ENTITY_LINK_PACKET; public $from; public $to; public $type; public function decode(){ $this->from = $this->getEntityUniqueId(); $this->to = $this->getEntityUniqueId(); $this->type = $this->getByte(); } public function encode(){ $this->reset(); $this->putEntityUniqueId($this->from); $this->putEntityUniqueId($this->to); $this->putByte($this->type); } public function handle(NetworkSession $session) : bool{ return $session->handleSetEntityLink($this); } }