use pocketmine\network\mcpe\handler\SessionHandler; class StopSoundPacket extends DataPacket{ public const NETWORK_ID = ProtocolInfo::STOP_SOUND_PACKET; /** @var string */ public $soundName; /** @var bool */ public $stopAll; protected function decodePayload() : void{ $this->soundName = $this->getString(); $this->stopAll = $this->getBool(); } protected function encodePayload() : void{ $this->putString($this->soundName); $this->putBool($this->stopAll); } public function handle(SessionHandler $handler) : bool{ return $handler->handleStopSound($this); } }