Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I'm trying to add sounds for a gun in a mod I'm working on with a friend(a mod based on the Carnivores series of games, i.e. Carnivores, Carnivores: Ice Age) and I'm not sure on the most recent methods used for this.

 

The tutorial for a blaster on the Forge wiki used this:

@ForgeSubscribe
   public void onSound(SoundLoadEvent event)
   {
       try
       {
       		String [] soundFiles = {
       				"lasershot.ogg",
       				"miningshot.wav",
       				"miningcharge.wav",
       				"miningLoaded1.wav",
       				"plasmaboil1.wav",
       				"plasmaboil2.wav",
       				"plasmaCharged.wav",
       				"plasmashot2.wav",
       				"plasmablast1.wav",
       				"blastershot1.wav",
       				"blastershot2.wav"
       				};
       		for (int i = 0; i < soundFiles.length; i++){
       			event.manager.soundPoolSounds.addSound(soundFiles[i], SenitielsSpaceMarineMod.class.getResource("/mods/SenitielsSpaceMarineMod/sounds/" + soundFiles[i]));
       		}
      
       }
       catch (Exception e)
       {
           System.err.println("Space Marine Mod: Failed to register one or more sounds.");
       }
   }

 

However, I have no idea what this would look like with 1.7.10 methods.

In 1.7, you no longer use any events at all, but a json file for sounds. Put it in your resources/assets directory (the base directory, not the sounds folder).

 

It should look something like this:

{
    "levelup": {"category": "player","sounds":["special/levelup"]},
    "master_sword": {"category": "ambient","sounds":["special/master_sword"]},
    "secret_medley": {"category": "ambient","sounds":["special/secret_medley"]}
}

Note that the final entry does not have a comma. The directory for those sounds is "assets/sounds/sound | subfolder"

 

EDIT: Btw, I have only used .ogg format in 1.7; I'm not sure if .wav works or not, so you'll have to try it.

  • Author

Yeah, I need to add sounds for the guns in the mod.  As in, sounds that play when the gun is used.

 

Edit: Nvm, got it working.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.