use pocketmine\network\mcpe\NetworkSession; class RemoveObjectivePacket extends DataPacket{ public const NETWORK_ID = ProtocolInfo::REMOVE_OBJECTIVE_PACKET; /** @var string */ public $objectiveName; protected function decodePayload(){ $this->objectiveName = $this->getString(); } protected function encodePayload(){ $this->putString($this->objectiveName); } public function handle(NetworkSession $session) : bool{ return $session->handleRemoveObjective($this); } }