Posted August 29, 201411 yr 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.
August 29, 201411 yr 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. http://i.imgur.com/NdrFdld.png[/img]
August 29, 201411 yr I have a tutorial on organizing and using sound assets in 1.7.x: http://jabelarminecraft.blogspot.com/p/minecraft-forge-1721710-organizing-and.html I do think you have to have your sounds in OGG format, but I discuss how to convert them in the tutorial. Check out my tutorials here: http://jabelarminecraft.blogspot.com/
August 29, 201411 yr 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.