[UNSOLVED] Sending a specific sound to player?

Discussion in 'Plugin Development' started by SnowGears, Apr 3, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    SnowGears

    I need to send a specific sound, in this case ambient.cave.cave12, but for some reason I cannot hear the sound when I test it. Was this method replaced by another packet or am I doing something wrong? Thanks in advance!

    By the way I do not want to use player.playSound() because I need to play this specific sound over and over and I do not want the other cave ambience sounds playing randomly.

    Here is my code that for some reason doesn't work.

    Code:java
    1.  
    2. Packet62NamedSoundEffect packet = new Packet62NamedSoundEffect("ambient.cave.cave12", player.getLocation().getBlockX(), player.getLocation().getBlockY(), player.getLocation().getBlockZ(), 1.0F, 1.0F);
    3. ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
    4.  
     
  2. Offline

    zajacmp3

    That is really interesting. I will test this method when I get some sleep.
    I hope someone will answer to this too :)
     
  3. Offline

    SnowGears

    Okay thanks! Hope we can figure it out!

    Bump?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 31, 2016
  4. Offline

    Flemingjp

    Try Packet62LevelSound, the a last two parameters are volume and pitch.
     
  5. Offline

    TheUpdater

    player.getWorld().playSound(l, Sound.SHOOT_ARROW, 3, 1);

    do that but change Sound.SHOOT to other
     
  6. Offline

    Vislo

  7. Offline

    nisovin

    You can't send a specific sound. If a sound has a number, you can only send the base sound, and the client will just choose one at random.
     
  8. Offline

    Wolf_Jacob

    Are they getting the sound if they type in a command or wat?
     
  9. Offline

    SnowGears

    Im testing with that. But the original plan was to play the specific sound over and over to them until a task was done.
     
  10. Offline

    noraver

Thread Status:
Not open for further replies.

Share This Page