Solved Player.playSound() Help

Discussion in 'Plugin Development' started by Jombi, Feb 24, 2014.

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

    Jombi

    Hello,

    I am working on using some sounds from a custom Resource Pack for various event such as specific commands, spawning/respawning, etc.

    For some sounds, I am able to play them easily and it works as expected. However, for others, it seems like it depends on the sound name or its location. For example, this is part of the RP sounds folder:

    -damage/
    --hit1.ogg
    --hit2.ogg
    --hit3.ogg
    -mob/
    --creeper/
    ---kill.ogg

    When I test the sounds using the /playsound command in Minecraft, I get the same results as I do when I code it using player.playSound(player,"sound.file",float1,float2), so I'll try to explain it using the command.

    /playsound damage.hit1 teh_jombi
    Displays the message saying the sound was played, but I hear nothing.

    /playsound mob.creeper.kill teh_jombi
    Displays the message saying the sound was played, and I DO hear the sound!

    After mucking about with the file locations, I found that if I renamed hit1.ogg in the damage folder to kill.ogg and replaced it in the mob.creeper folder, I could get it to play the sound!

    Has anyone else experienced this and have some tips?
     
  2. Offline

    qlimax5000

    Try just using damage.hit
    I think it chooses a random hit sound
     
  3. Offline

    Jombi

    Wrong. It doesn't just choose a random sound to play...

    I had a faulty json file. Works now :D
     
Thread Status:
Not open for further replies.

Share This Page