Resource pack and custom sounds

Discussion in 'Plugin Development' started by Pr07o7yp3, Sep 2, 2014.

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


    I have a problem with Resource pack and custom sounds.
    My directory structure in the resource pack:

    My sounds.json
      "": {
        "category": "music",
        "sounds": [
          "name": "lc/music/m1",
          "stream": true
    I'm trying to play this song with:
    1. ((CraftPlayer) player).getHandle().playerConnection.sendPacket(new PacketPlayOutNamedSoundEffect("", player.getLocation().getBlockX(), player.getLocation().getBlockY(), player.getLocation().getBlockZ(), 100000.0F, 1.0F));

    but the song wont play for some reason.
    If I try to play different song that exists in minecraft there is no problem.

    What I missed...
  2. Offline


    player.playSound(Location arg0, String arg1, float arg2, float arg3)
  3. Offline


    I tried with this. Like I said, I can play default songs, but I can't play my custom song.
    I think I missed something in the resource pack or sounds.json.
  4. Offline


    the m1.ogg is definitely a playable ogg format file? or did you just rename it from a mp3 or wav file?
  5. Offline


    Yes, i'm sure it's playable ogg format because if I rename and move it:
    assets/minecraft/sounds/records/cat.ogg I can play it without any problems.

    EDIT. Fixed it. :D I had an error in sounds.json ;)
Thread Status:
Not open for further replies.

Share This Page