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

Solved Sounds

Discussion in 'Development' started by MalakasPlayzMCPE, Mar 2, 2019.

  1. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    Hey! So I need some help with the sounds. After the 1.8 update, I am not able to use sounds anymore, not with the way I did before at least.
    As of this update, I am not able to set the "volume" of a noteblock sound. Here is my old code:

    PHP:
            $volume 1;
            
    $pitch 2;
            
    $pk = new LevelSoundEventPacket();
            
    $pk->sound LevelSoundEventPacket::SOUND_NOTE;
            
    $pk->position $player->asVector3();
            
    $pk->volume $volume;
            
    $pk->pitch $pitch;
            
    $pk->unknownBool true;
            
    $pk->unknownBool2 true;
            
    $player->dataPacket($pk);
    My updated code:

    PHP:
            $pitch 2;
            
    $pk = new LevelSoundEventPacket();
            
    $pk->sound LevelSoundEventPacket::SOUND_NOTE;
            
    $pk->position $player->asVector3();
            
    $pk->extraData $pitch;
            
    //$pk->entityType = ":"; //what to put there??
            
    $player->dataPacket($pk);
    With the updated code, the sound does not sound as it did before too. Does anybody know how to make that working again? Any reply is appreciated.
     
  2. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    Fixed using some nasty hacks, thanks to my friend.
     
  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.