How to add custom sounds to resource pack

Adding sounds to a Minecraft resource pack isn’t that complicated but these are some rookie mistakes you can do and should avoid.

Step 1: Add your own sounds.json

To avoid having to merge sounds.json files you should create your own namespace.

In this example we will create one that’s called “yoursound”, let’s start with creating this file:

/assets/yoursound/sounds.json

{
  "example.sound.name_1": {
    "sounds": [
      "whatever/path/example_1"
    ]
  },
  "example.sound.name_2": {
    "sounds": [
      "whatever/path/example_2"
    ]
  }
}

Here’s we’re telling the game that we have 2 new sounds that are called “example.sound.name_1” and “example.sound.name_2”.

Step 2: Add your sound files

In step 1 we defined 2 new sounds but we need to add the actual sound files, here are the paths:

/assets/minecraft/sounds/whatever/path/example_1.ogg

/assets/minecraft/sounds/whatever/path/example_2.ogg

You can also just put these in your namespace folder and not in the minecraft folder by defining the namespace in the file path.

Step 3: Test your new sounds

Type this command in-game:

/playsound yoursound:example.sound.name_1 hostile YourUsername

If you can hear the sound, you’ve done it all correct and you’re done!

Step 4: More advanced settings

In your sounds.json you can define a ton of settings in each new defined sound, for example we could add a subtitle that shows to the player when they hear the sound:

{
  "example.sound.name_1": {
    "subtitle": "hello",
    "sounds": [
      "whatever/path/example_1"
    ]
  },
  "example.sound.name_2": {
    "sounds": [
      "whatever/path/example_2"
    ]
  }
}

Now when the player hears example.sound.name_1 they will also get a subtitle above their action bar saying “hello”.

There are only 3 main settings which are:

  • replace – if this should replace the sounds in default sounds.json
  • subtitle – shows subtitle to the player
  • sounds – The sound files this sound event uses. One of the listed sounds is randomly selected to play when this sound event is triggered. Optional.

But within the sounds setting you can also add a bunch of settings:

  • name – the url of the sound file excluding the .ogg extension.
  • volume – the volume betweenn 0.0 and 1.0, default is 1.0
  • pitch – plays the sound at specific pitch, if not defined it will always be 1.0
  • weight – the chance that this sound is selected when multiple sounds are defined, default is 1
  • stream (true/false) – True if this sound should be streamed directly from the file, set to true if the sound is longer then a few seconds to avoid lag. This is typically used for all the sounds in music and record categories.
  • attenuation_distance – Sound reduction rate based on distance, typically used by beacons, portals and conduits. Default is 16.
  • preload (true/false) – True if the sound should be loaded when the resource pack is loaded instead of when the sound plays to the user. Defaults to false.
  • type (sound or event) – Sound causes the value of “name” to be interpreted as the name of the file path, while event causes the value of “name” to be read as a predefined event in the game. Set to “sound” by default.

Let’s add a more advanced example to our sounds.json

{
  "example.sound.name_1": {
    "subtitle": "hello",
    "sounds": [
      "whatever/path/example_1"
    ]
  },
  "example.sound.name_2": {
    "sounds": [
      "whatever/path/example_2"
    ]
  },
   "example.sound.name_3": {
    "category": "hostile",
    "sounds": [
      {
        "name": "whatever/path/example_3",
        "volume": 0.5,
        "pitch": 2.5
      },
      {
        "name": "whatever/path/example_4",
        "volume": 0.2,
        "pitch": 0.8
      },
      {
        "name": "whatever/path/example_5",
        "volume": 1.5,
        "pitch": 1.5,
        "weight": 3
      }
    ]
  }
}

Now we’ve added a third custom sound that does these things:

  • Plays 1 out of the 3 .ogg files specified randomly.
  • Defaults as a hostile mob sound.
  • Each of the .ogg files has it’s own defined volume and pitch.
  • The third sound/ogg is 3 times more likely to be played thanks to it’s weight.

If you need more guidance you can read the minecraft wiki sounds.json article, or read more MC Models tutorials.