Tutorials/Adding Sounds To Animations
Preface
This is an advanced tutorial that will show you how to add sounds to your custom Pokémon's animations. It is required that you are familiar with the process of creating a custom Pokémon. You will need a finished model, an animation to apply the sounds to, and a sound file to apply to the animation. While the steps in this guide can be used to add any sound to any animation, it will primarily focus on adding a cry to your Pokémon.
Acquiring a valid ogg
sound file to use is entirely on you. You will either have to make or find one.
Recommended Tools
This section will list some free tools and resources that can help you format your files and folders.
- A Text Editor - If you are not using one already, they can be helpful for editing multiple files at once
- Recommendations:
- Visual Studio Code - You can open your entire addon folder and access all content within. Can also play sound files. Helps you visualize the folder structure of your addon.
- Recommendations:
- Audio Editing Software - Minecraft only plays
ogg
sound files. You'll need something to convert audio files into this format.- Recommendations:
- Audacity - Free software with many video tutorials on YouTube. Allows you to edit the sound file and export it to
ogg
format.
- Audacity - Free software with many video tutorials on YouTube. Allows you to edit the sound file and export it to
- Recommendations:
- Blockbench - You will need it to load, edit, and export your animations.
- The sounds.json Wiki Page - Lists some helpful properties you can use when creating the sounds JSON.
Step 1: Arrange The Folders Of Your Addon
Adding sounds would require you to add a sounds.json
and one new branch of sound folders to your existing addon. For the sake of clarity, a complete addon with sounds would be arranged like so:
Folder Structure
- (addon name)
- pack.mcmeta
- assets
- cobblemon
- bedrock
- pokemon
- animations
- <folder named after your pokemon>
- <pokemon>.animation.json
- <folder named after your pokemon>
- models
- <folder named after your pokemon>
- <pokemon>.geo.json
- <folder named after your pokemon>
- posers
- <pokemon>.json
- resolvers
- <folder named after your pokemon>
- 0_<pokemon>_base.json
- <folder named after your pokemon>
- animations
- pokemon
- lang
- en_us.json
- sounds.json
- sounds
- pokemon
- <folder named after your pokemon>
- <sound>.ogg
- <folder named after your pokemon>
- pokemon
- textures
- pokemon
- <folder named after your pokemon>
- <pokemon>.png
- <pokemon>_shiny.png
- <folder named after your pokemon>
- pokemon
- bedrock
- cobblemon
- data
- cobblemon
- spawn_pool_world
- <pokemon>.json
- species
- custom
- <pokemon>.json
- custom
- spawn_pool_world
- cobblemon
Arrange your asset folder similarly to the tree above so you can simply insert any new files with ease.
Step 2: Adding The Sound Keyframe
To get started, you will need one or more valid ogg
sound files to use for your animations. Create one if you haven't already. You will be loading and editing your asset files in Blockbench for this step.
- Prepare your sound file(s)
- Open up Blockbench and load your model, texture, and animation files.
- Navigate to the animate tab and select the animation you want to add sounds to
- If you don't have one, you can make one now. Making a simple cry animation where the Pokémon opens its mouth or some similar motion is recommended.
- Once your animation is selected, navigate to the
TIMELINE
window and click on theAnimate Effects
button. - Click on the
+
button forsound
to generate a new sound keyframe- The
KEYFRAME
window should have opened up once the keyframe was made
- The
- Navigate to the
KEYFRAME
window and create an effect name for this keyframe- This would create a
sound event
which Minecraft can use to play a sound when this animation is played. - In the case of making cries, this effect should be named
pokemon.<pokemon>.cry
- Example:
pokemon.charizard.cry
- Example:
- This would create a
- Click on the
Select Keyframe File
located to the right of youreffect
name. - Select and upload one of your prepared sound files
- This will let the sound play in Blockbench whenever the sound keyframe is played in the animation.
- Adjust and edit the animation to your liking.
- Now you can hear and see your animation. Should be easier to make adjustments.
- Once satisfied with your animation, save and export your animations to your addon.
- Be sure to replace the old animation json in the folder. This new export has the data required to play the sound.
- If you made any changes to the model or texture, be sure to export those again too.
- If you just made a cry animation now, remember to add that animation to your Pokémon's
poser
file. - At most, you should have exported your animations, model, and texture. Don't worry about the sound file yet. Those will be arranged next.
Step 3: Arrange Your Sounds
Your sound files should be kept in the same format as Cobblemon's sound files. This should make it easier to mimic the sounds.json
in the next step.
- Insert your
ogg
sound file into the folder named after your pokemon located deeper in the sounds folder. - Rename this file to match the cry sound format of
<pokemon>_cry.ogg
- Example:
charizard_cry.ogg
- Can actually be named whatever you want. Just make sure you reference it correctly in Step 4.
- Example:
If done correctly, your sound file should have a file address similar to this:
<your addon name> > assets > cobblemon > sounds > pokemon > <your pokemon>
You should end up with one or more <pokemon>_cry.ogg
files in your Pokémon's sound folder. Depends on what you're making.
Step 4: Create The sounds.json
The next step is to create a sounds JSON to play your sounds in Minecraft. The sounds.json
is responsible for assigning sound files to any sound events. This file is not exclusive to Cobblemon. You can learn more about it from the Minecraft Wiki.
The name of your sound event
just needs to match the name of the effect
you made in the previous section. It does not need to be a cry.
- Create a new text file and name it
sounds.json
- Make sure this new file name ends in .json and not any other file extension like .txt.
- Open this new JSON in your preferred text editor
- Copy and paste this entire code block example into the JSON
- If you have more than one cry file, you can list more file addresses. They would have equal chances to be played by default.
{ "pokemon.charizard.cry": { "sounds": ["cobblemon:pokemon/charizard/charizard_cry"] } }
- Change all instances of "charizard" to be your Pokémon's name instead.
- If desired, add any special properties you want like subtitles.
- Save the file
- Insert this finished
sounds.json
into thecobblemon
folder of your addon.- It must be in this folder and nowhere else. Otherwise, it wont be read.
- Should be seated next to your sounds folder.
Step 5: Test Your Addon In Game
The final step is to make sure the sounds work.
- Copy your addon folder and place it in the "resourcepacks" and appropriate "datapacks" folder in the Minecraft root directory.
- Start up Minecraft and click on Options, then Resource Packs. Select your pack to load it.
- Make sure you are using a version of your addon that includes all the new files and re-exports you just made.
- Load/create a Creative world save that contains your addon in the "datapacks" folder.
- Once in the world, you can run the command
/pokegive <target pokemon>
.- Since cries are only played when a Pokémon is brought out of the pokeball or sent into battle, you need to have the Pokémon in your party.
- Send out your Pokémon.
- If you assigned the sound properly to a cry animation, it should play the sound now.
- If you assigned it to another animation, have your Pokémon perform that animation instead and listen for the sound.
If the sound is not being played, then something is not assigned properly. Make sure you followed the steps of this guide correctly and that your folder and file names are valid. Any capital letters or spaces in a file or folder name makes it unreadable. Additional help can be found in the Cobblemon Discord server.