🔊Sounds

Step 1

Convert sound to .ogg
  • open plugins\ItemsAdder\data\resource_pack\assets folder

  • open your namespace folder

  • create a new folder called sounds

  • put your .ogg file in there (you can also create another folder to organize your sounds, for example "effects" folder, "music" folder...)

for example I have a file named cdk_sunday.ogg and I put it into a new music_disc folder. So now I have plugin\ItemsAdder\data\resource_pack\assets\NAMESPACE\sounds\music_disc\cdk_sunday.ogg

Step 2

  • open plugins\ItemsAdder\data\resource_pack\assets folder

  • open your namespace folder

  • create a new file named sounds.json (or open it if you already created)

  • this file is a json file, you MUST write it corretly or it won't work. If you need info about Json files please search online.

To add your sound into the file you just have to do this:

{
	"music_disc.cdk_sunday":{
		"sounds":[
			"myitems:music_disc/cdk_sunday"
		]
	}
}

Now I explain each part of the code I wrote. This is the sound name, you will use it in every part of the plugin and also in Minecraft vanilla /playsound command

"music_disc.cdk_sunday":{

This is the list of sound files Minecraft will play when you call the sound name. Minecraft will play one of these sounds randomly (only if you set more than one sound). ⚠️Keep in mind that you have to change myitems to your own namespace name.

"sounds":[
			"myitems:music_disc/cdk_sunday"
		]

For example if you want to have random sounds for the same sound name you just have to create multiple .ogg files and put them like this:

"sounds":[
			"myitems:music_disc/cdk_sunday_1",
			"myitems:music_disc/cdk_sunday_2",
			"myitems:music_disc/test_file"
		]

How can I add multiple sounds in the sounds.json file?

It's easy, the next time you want to add a sound you just have to add a comma at the end, like this. (I'm referring to line 6 comma)

{
    "music_disc.cdk_sunday":{
        "sounds":[
            "itemsadder:music_disc/cdk_sunday"
        ]
    },
    "music_disc.vidian_aether_theories":{
        "sounds":[
            "itemsadder:music_disc/vidian_aether_theories"
        ]
    }
}

If you want to be sure not to make mistakes use this website to check if your Json file is good or has errors: https://jsonformatter.curiousconcept.com/

Last updated