Playing custom sounds from resourcepack


#1

I’m looking for help with making a custom server resourcepack for adding music files that will be playable to individual players using the playsound command. I’ve looked at 4 different resourcepack tutorials and the Sponge Docs (looking to automate the process of the music being played by implementing the GriefPrevention API to have the plugin listen for the player entering a claim and then playing the sound that would go with the area that they just entered type of thing) as well as Google, but I can not - for the life of me - get the stupid custom sound to play when trying to trigger it manually. And, obviously, if I can’t even trigger it manually, no way I’d be able to trigger it automatically.

So, if anyone has any experience with an issue like this, I would greatly appreciate some advice on what I’m doing wrong.

The server is running Pixelmon as its only mod installed (that would be adding texture/sound files anyway), so I’m not sure if that is making a difference or not, but I’m adding in the custom music files to the resourcepack, in the assets>minecraft>sounds>music folder, and the file type is a .ogg.

I’m using the /playsound command to try to trigger it manually, using “/playsound music.SOUND_NAME master @a” but nothing plays. The .ogg file is only about 1:15 long, so the delay between the command being executed and the music starting to play shouldn’t be that long, but I’ve waited a good 10 minutes for it to start playing and never heard it.

The .json is located in the assets>minecraft folder, the same location as where my sounds folder is. And, it is formatted in the same way that was shown to me in all the resourcepack tutorials I have watched.

After all this, my sound still isn’t playing and I’m getting frustrated at my own confusion. So, again, any help would be greatly appreciated. Thanks in advance!


#2

You keep saying that you’ve done it correctly, but you haven’t actually said how it is that you’ve done it. Folder path to the file, contents of sounds.json as a gist, etc.


#3

The resourcepack itself is already created and working, with the textures that were added to replace the Pixelmon textures working perfectly fine, so the resourcepack itself is setup correctly. There is just something wrong with how I’m trying to add the sound files and/or trying to play them. I’ve explained how my additions to the pack are setup. I’m unfamiliar with this gist thing you linked, but I am willing to provide any other information you need if you can help out. Thanks!


#4

That is not what I was asking for.


#5

There’s your gist of the contents of the sounds.json file.

How else do you want me to tell you the folder path to the file? I’ve told you it is in the assets>minecraft>sounds>music folder, meaning the file is in the music folder, in the sounds folder, in the minecraft folder, in the assets folder of the resourcepack. I really don’t know any other way to explain it, so I will show a screenshot of where it is as well.

Again, thank you for your time and sorry for being confusing.


#6

All right, that does look right. Are you sure the .ogg is encoded right, and is it possible the command is playing it at the wrong volume?
Another thing to do: Try to tab-complete the sound. If you can’t, that lets us know whether it’s a problem with the sound or a problem with the loading.


#7

The .ogg might not be encoded right. I used an online audio file converter instead of using Audacity as was suggested. Trying to tab- complete the command doesn’t work either. Just brings up default Minecraft and Pixelmon sounds.

I’ve tried playing it from different sources (master and music), as well as specifying all optional arguments in the command syntax, such as the coordinates, volume, pitch, and whatever that third option was, which I think was the radius.


#8

OK. And just to get the stupid question out of the way - the resource pack is loaded, right?
If so, could you zip the pack and send it my way?


#9

Yes, the pack is loaded. No worries, I had to double check that myself. XD I’ll send you a Dropbox link for it.


#10

The pack you sent me had an error in its sounds.json file - you forgot an opening brace after the opening bracket and a closing brace after the closing bracket. Once I added those, it worked fine.


#11

I added those to my sounds.json file as well but it’s still not working for me.

Just to be sure, by ‘opening brace after the opening bracket and closing brace after the closing bracket’, you mean:

{[
“route1”: {
“category”: “music”,

         "sounds": [

               "name": "custom/route1",
               "stream": true }]

}]

Correct?

Perhaps there’s an error in my command syntax? I’m using “/playsound route1 master Zylaz”


#12

No, that’s not what I meant. You’ve mixed up brace and bracket.

{
  "route1": {
    "category": "music",
    "sounds": [
      {
        "name": "custom/route1",
        "stream": true 
      } 
    ]
  }
}

This isn’t some magic ‘insert symbols until it works’ thing. You have to match each opening character with an identical closing character, in the reverse sequence you opened them with. Proper indentation like this helps.

By the way, “category”, while it won’t cause an error, is a deprecated field since 1.10 and will have no effect.


#14

I fiddled around with it and got it working. Thanks for all your help! I appreciate it! :slight_smile:

(I had asked for help with another issue but I figured it out so I deleted the comment)