๐Ÿ”Š
Sounds

Step 1

  • 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 correctly 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:
1
{
2
"music_disc.cdk_sunday":{
3
"sounds":[
4
"myitems:music_disc/cdk_sunday"
5
]
6
}
7
}
Copied!
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
1
"music_disc.cdk_sunday":{
Copied!
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.
1
"sounds":[
2
"myitems:music_disc/cdk_sunday"
3
]
Copied!
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:
1
"sounds":[
2
"myitems:music_disc/cdk_sunday_1",
3
"myitems:music_disc/cdk_sunday_2",
4
"myitems:music_disc/test_file"
5
]
Copied!

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)
1
{
2
"music_disc.cdk_sunday":{
3
"sounds":[
4
"itemsadder:music_disc/cdk_sunday"
5
]
6
},
7
"music_disc.vidian_aether_theories":{
8
"sounds":[
9
"itemsadder:music_disc/vidian_aether_theories"
10
]
11
}
12
}
Copied!
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/โ€‹