Jump to content

Recommended Posts

Posted

So back in 1.6 to register a sound you had to do:

event.manager.addSound(String);

But now addSound doesnt seem to exist and i cannot, for the life of me, figure what replaced it. could anyone help me out here? Also i noticed @ForgeSubscribe is no longer an annotation and again, im lost as to what replaced it, im guessing it was maybe @EventHandler, but i do not know for sure.

 

Thank you in advanced :)

Posted

In 1.7.2, you don't add sounds or register them, you use a sounds.json file located next to your 'sounds' folder in your assets directory.

 

It should look something like this:

 

{
    "swordstrike": {"category": "player","sounds": ["sword/swordstrike1","sword/swordstrike2","sword/swordstrike3","sword/swordstrike4"]},
    "master_sword": {"category": "ambient","sounds":["special/master_sword"]}
}

 

The first " " is the String you will use to refer to your sound in the mod, so when you play the sound, it would be "yourmodid:sound_name".

 

The category "player", "ambient", etc., is the volume control option that affects the volume of your sound in game.

 

You can place your sounds in subdirectories like I did ("sword", "special", etc.), or just have them all in the base sounds directory.

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.