Adding Sounds to your Animation - varun-liver/animationlib GitHub Wiki

To add sounds to your animation:

At Runtime

  1. Get an Ogg sound file, put it in src\main\resources\assets\<modid>\animationlib\sounds
  2. Add a sound field to your animation JSON:
"sound":"<modid>:<sound_file_name>"

Add no extention to the name. 3. Play the sound as usual, using either <animation_name>.play(entity) or /animation <modid>:<sound_file_name>

Play only sound

To play only sound in your Animation, use the play() function and stop() function:

import con.animationlib.api.AudioTrack;

Audiotrack.play("<modid>:<file_name>")
Audiotrack.stop("<modid>:<file_name>")
⚠️ **GitHub.com Fallback** ⚠️