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