Play sound from texturepack

Discussion in 'Plugin Development' started by Xogos1997, Oct 26, 2014.

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

    Xogos1997

    hi. i have problem i create texturepack for my server and i need code for play sound here is my code.
    Code:
     player.playSound(player.getLocation(), ".minecraft//resourcepacks//assets//minecraft//sounds//sword_swipe.ogg", 1,1);
    Not working can you help me please? thx
     
  2. Offline

    TheCodingCat

    well Xogos1997 if its a custom resource pack and you are making custom sounds, I'm not usre if you can play them. I think you need to replace minecraft sounds. And if you want to get it, you put the name of the sound you replaced
    "Sound.something.something"
     
  3. Offline

    Gamecube762

    TheCodingCat You can play any sound, even if the server has no clue what the sound is. All sounds are managed client sided and are defined by resource-packs. The server just tells the client when to start a sound.

    So even if a sound is "a.b.foo.bar", as long as the resource-pack defined it, the client will play it.
     
  4. Offline

    marti.2001

    I'm pretty sure you can do it with packets
     
  5. Offline

    Gamecube762

    marti.2001 You can, but player.playSound() does it without you having to dig into NMS.
     
Thread Status:
Not open for further replies.

Share This Page