Posted July 5, 201312 yr hey guys, im trying to get my custom sounds to play when i right click an item. when i right click it, i get no errors, but also no audio, can anyone help me out here? my sound reg code package naturemod.common.handlers; import net.minecraft.client.audio.SoundManager; import net.minecraftforge.client.event.sound.SoundLoadEvent; import net.minecraftforge.event.ForgeSubscribe; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class EventSounds { @SideOnly(Side.CLIENT) @ForgeSubscribe public void onSoundsLoaded(SoundLoadEvent event) { SoundManager manager = event.manager; String [] soundFiles = { "rasta.wav"}; for (int i = 0; i < soundFiles.length; i++){ manager.soundPoolSounds.addSound("/assets/nature/resource/sound/" + soundFiles); } } } my item code package naturemod.common.items; import java.util.List; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import naturemod.common.Nature; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumToolMaterial; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemTool; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; public class ItemSpliff extends Item { public ItemSpliff(int id) { super(id); maxStackSize = 1; this.setCreativeTab(Nature.natureTabItem); } @SideOnly(Side.CLIENT) /** * Returns True is the item is renderer in full 3D when hold. */ public boolean isFull3D() { return true; } @SideOnly(Side.CLIENT) /** * Returns true if this item should be rotated by 180 degrees around the Y axis when being held in an entities * hands. */ public boolean shouldRotateAroundWhenRendering() { return true; } public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { if (!par3EntityPlayer.capabilities.isCreativeMode) { --par1ItemStack.stackSize; } par2World.playSoundAtEntity(par3EntityPlayer, "rasta", 1F, 1F); if (!par2World.isRemote) { if(!this.isDamaged(par1ItemStack)) { //par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.blindness.id, 600, 9)); par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.confusion.id, 600, 9)); //par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() + 1); } } return par1ItemStack; } public EnumRarity getRarity(ItemStack stack) { return EnumRarity.epic; } public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { par3List.add("\u00a77Good Times Guaranteed"); } @Override @SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister) { this.itemIcon = par1IconRegister.registerIcon("Nature:spliff"); } }
July 5, 201312 yr i'm looking for a way to add custom sounds as well! if you figure anything out, PLEASE tell me! thanks! -sorash67 || Skorpio *** NOW 1.6.2 *** http://www.minecraftforum.net/topic/1839245-16115-forge-sspsmp-skorpios-notonlymoreores-mod-now-162/
July 5, 201312 yr I think we need to wait 'till theres a stable build of forge ... http://i.imgur.com/sKDS7bj.png[/img] http://www.minecraftforum.net/topic/1877292-15x-forge-smp-nightmarecraft-alpha-10-it-started-with-a-dream-new/
July 5, 201312 yr As far as I have heard on twitter and here, the system ain't working as intended yet. I'd wait for the next recommended update before trying to make everything work If you guys dont get it.. then well ya.. try harder...
July 5, 201312 yr yep, that's true! -sorash67 || Skorpio *** NOW 1.6.2 *** http://www.minecraftforum.net/topic/1839245-16115-forge-sspsmp-skorpios-notonlymoreores-mod-now-162/
July 9, 201312 yr Anyone know if this lack of sound issue is fixed in latest forge yet? If so, what is the correct formatting for registering and playing sounds now that the URL parameter is dropped. Got my textures working, but still no sound effects UPDATE: Forge 784 is current recommended as of an hour ago
July 9, 201312 yr Solution is here -> http://www.minecraftforge.net/forum/index.php/topic,10078.0.html
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.