Im trying to play sound to player with LevelSoundEventPacket but the sound stays on given position so when i leave him i cant hear it. Is there a way to play sound to player but not to position?
If you want to broadcast a sound to all online players, just foreach Server->getOnlinePlayers() and make a LevelSoundEventPacket for each with their current position
you gan also do like this PHP: use pocketmine\network\protocol\mcpe\PlayerSoundPacket;$pk = PlaySoundPacket;$pk->soundName = "random.pop"; // string$pk->volume = 1; // numeric$pk->pitch = 1; // numeric$pk->x = $player->x; $pk->y = $player->y;$pk->z = $player->z;$player->dataPacket($pk); // send sound only to one player sound list can be found here https://www.digminecraft.com/lists/sound_list_pe.php