Posted August 5, 201312 yr Ok so last time I posted, Mazetar helped me out with adding sword sound but.... that was in 1.5 now its 1.6. I've been trying really hard to add these sounds but this is the only thing I have seen on the inter webs. sound file package brenden.viking; import net.minecraftforge.client.event.sound.SoundLoadEvent; import net.minecraftforge.event.ForgeSubscribe; public class vikingsound { @ForgeSubscribe public void onSound(SoundLoadEvent event) { try { event.manager.addSound("attacking.wav"); event.manager.addSound("medieval:fireshot2.wav"); event.manager.addSound("medieval:fireshot3.wav"); } catch (Exception e) { System.err.println("Fire sounds error"); } } } In sword class public ItemStack onItemLeftClick(ItemStack ItemStack, World par2World, EntityPlayer par3EntityPlayer) { if (!par3EntityPlayer.capabilities.isCreativeMode) { --ItemStack.stackSize; } par2World.playSoundAtEntity(par3EntityPlayer, "brenden:attacking", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); if (!par2World.isRemote) { par2World.spawnEntityInWorld(new VikingSword_Entity(par2World, par3EntityPlayer)); } return ItemStack; } I dont know what to do now with this. If anyone could help a noob that would be lovely! thanks a million
August 5, 201312 yr Well this is quite simple. addSound("attacking.wav"); playSoundAtEntity(par3EntityPlayer, "brenden:attacking" Doesn't match.
August 6, 201312 yr ); how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
August 6, 201312 yr Author Well this is quite simple. addSound("attacking.wav"); playSoundAtEntity(par3EntityPlayer, "brenden:attacking" Doesn't match. addSound("attacking.wav"); playSoundAtEntity(par3EntityPlayer, "attacking.wav" doesn't work.
August 8, 201312 yr Author Let us see your new code then. Idk know if im not implementing this right or what, but... sword class! public boolean hitEntity (ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving) { par3EntityLiving.worldObj.playSoundAtEntity(par3EntityLiving, "brenden:attacking", 1.0F, 1.0F); { par1ItemStack.damageItem(1, par3EntityLiving); return true; } } public ItemStack onItemLeftClick(ItemStack ItemStack, World par2World, EntityPlayer par3EntityPlayer) { if (!par3EntityPlayer.capabilities.isCreativeMode) { --ItemStack.stackSize; } par2World.playSoundAtEntity(par3EntityPlayer, "brenden:attacking", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); if (!par2World.isRemote) { par2World.spawnEntityInWorld(new VikingSword_Entity(par2World, par3EntityPlayer)); } return ItemStack; } sound class package brenden.viking; import net.minecraftforge.client.event.sound.SoundLoadEvent; import net.minecraftforge.event.ForgeSubscribe; public class vikingsound { @ForgeSubscribe public void onSound(SoundLoadEvent event) { try { event.manager.addSound("brenden:attacking.wav"); } catch (Exception e) { System.err.println("Fire sounds error"); } } } Thanks for your time!
August 8, 201312 yr Your sound should be placed like this: mcp/src/minecraft/assets/brenden/sound/attacking.wav
August 8, 201312 yr Author Your sound should be placed like this: mcp/src/minecraft/assets/brenden/sound/attacking.wav do you think this may be the problem? par2World.spawnEntityInWorld(new VikingSword_Entity(par2World, par3EntityPlayer));?
August 8, 201312 yr No, actually the main problem is that those methods are not used by Minecraft any more: public boolean hitEntity (ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving) public ItemStack onItemLeftClick(ItemStack ItemStack, World par2World, EntityPlayer par3EntityPlayer) You have to update them.
August 8, 201312 yr If you add @Override above methods, you will get warnings and errors when they are removed/replaced/renamed! Use @Override above any method which overrides a parents method. then you will at least not encounter this again If you guys dont get it.. then well ya.. try harder...
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.