1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

LevelSoundEventPacket - certain sounds not working?

Discussion in 'Development' started by Spajk, Apr 23, 2017.

  1. Spajk

    Spajk Spider

    Messages:
    8
    GitHub:
    spajk7
    Hello, I am trying to play a sound using LevelSoundEventPacket and I can play certain sounds like HIT, BREAK, PLACE, etc without a problem, but when I tried playing THUNDER and EXPLOSION nothing happened.
     
  2. Zayd

    Zayd Witch

    Messages:
    55
    GitHub:
    ZaydPE
    Errors? Code?
     
  3. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    make sure you are using the api3/network branch of PocketMine
     
  4. Spajk

    Spajk Spider

    Messages:
    8
    GitHub:
    spajk7
    What's the difference ?
     
  5. moska

    moska Baby Zombie

    Messages:
    105
    GitHub:
    supermaxalex
    @jasonwynn10 just didn't understand your problem, nothing will change.
    To play them, you need to modify $pk->extraData and $pk->pitch
     
  6. moska

    moska Baby Zombie

    Messages:
    105
    GitHub:
    supermaxalex
    And I don't know what's the int of them :/ Maybe, do a var_dump() and you will find what numbers you need to set.
     
  7. Spajk

    Spajk Spider

    Messages:
    8
    GitHub:
    spajk7
    extraData is volume, I set it 100 and I can hear sounds like hitting and placing blocks.

    How can I monitor packets and how can I trigger the thunder naturally ?
     
  8. tungstenvm

    tungstenvm Witch

    Messages:
    54
    i found thing in pocketmine that no one know but the pmmp dev,
    Code:
    use pocketmine\network\mcpe\protocol\PlaySoundPacket;
                $sound = new PlaySoundPacket();
                $sound->x = $player->getX();
                $sound->y = $player->getY();
                $sound->z = $player->getZ();
                $sound->volume = 3;
                $sound->pitch = 2;
                $sound->soundName = "AMBIENT.WEATHER.LIGHTNING.IMPACT";
                $this->getServer()->broadcastPacket($player->getLevel()->getPlayers(), $sound);
    and i found a list of name here https://github.com/ClearSkyTeam/ClearSky/blob/master/src/pocketmine/resources/clientsounds.json
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.