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

tried everything and still no maybe im calling it wrong when trying to use it or maybe the sound code is wrong anyway on right click its supposed to be calling a sound here a my class files

 

 

ClientProxy

package medieval.medievalproxy;

import medieval.medievalentities.Firebolt_Entity;
import medieval.medievalentities.Pixie_Entity;
import medieval.medievalmodels.Pixie_Model;
import medieval.medievalrender.Firebolt_Render;
import medieval.medievalrender.Pixie_Render;
import medieval.medievalsounds.Firebolt_Sound;
import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.client.registry.RenderingRegistry;



public class ClientProxy extends ServerProxy

{

@Override
public void registerRenderThings()
{

        RenderingRegistry.registerEntityRenderingHandler(Pixie_Entity.class, new Pixie_Render(new Pixie_Model(), 0.3F));
        RenderingRegistry.registerEntityRenderingHandler(Firebolt_Entity.class, new Firebolt_Render());
        System.err.println("ClientProxy renders Loaded");
}
@Override
public void registerRenderers() 
{
	MinecraftForge.EVENT_BUS.register(new Firebolt_Sound());
	System.err.println("ClientProxy Sounds Loaded");
}

}

 

 

Sound File

package medieval.medievalsounds;

import medieval.Medieval;
import net.minecraftforge.client.event.sound.SoundLoadEvent;
import net.minecraftforge.event.ForgeSubscribe;

public class Firebolt_Sound 

{

	@ForgeSubscribe
    public void onSound(SoundLoadEvent event)
    {
        try 
        {
        	event.manager.addSound("medieval:firebolt1.wav");
        	System.err.println("Firebolt Sounds Loaded");
        }
        catch (Exception e)
        {
            System.err.println("Firebolt sounds error");
        }

    }
}

 

and here is what calls it

package medieval.medievalitems.wands;

import medieval.Medieval;
import medieval.medievalentities.Firebolt_Entity;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;

public class Fire_Wand extends Item
{
public Fire_Wand(int ItemID)
{
super(ItemID);
this.setCreativeTab(Medieval. medievaltab);
}



  @Override
  public ItemStack onItemRightClick(ItemStack ItemStack, World par2World, EntityPlayer par3EntityPlayer)
  {
      if (!par3EntityPlayer.capabilities.isCreativeMode)
      {
          --ItemStack.stackSize;
      }

      par2World.playSoundAtEntity(par3EntityPlayer, "medieval:firebolt1", 1.0F, 1.0F);

      if (!par2World.isRemote)
      {
          par2World.spawnEntityInWorld(new Firebolt_Entity(par2World, par3EntityPlayer));
      }
   
      return ItemStack;
  }
  public void registerIcons(IconRegister reg) {

	this.itemIcon = reg.registerIcon("medieval:firewand");
	}
public boolean hasEffect(ItemStack par1ItemStack) {
	return true;
}
public String Version()
{
	return "1.6.2";
}
}

I like helping people because i was also in a same problem and i do not like unfinished work, so a thank you will be enough for the people im helping and a thank you to the people that helped me :)

when you call for it, don't ask for firebolt1. Ask for firebolt.

 

If a name ends with a number it will be grouped as the name before the number.

This is to make it possible to have random sound variations.

 

If you enter two sounds:

event.manager.addSound("medieval:firebolt1.wav");
event.manager.addSound("medieval:firebolt2.wav");

and when you play the sound say:

 par2World.playSoundAtEntity(par3EntityPlayer, "medieval:firebolt", 1.0F, 1.0F);

 

It will randomly choose either firebolt1 or firebolt2 to play :)

 

If you guys dont get it.. then well ya.. try harder...

  • Author

maybe my sound file is in the wrong place i have it here

assets\medieval\sound

I like helping people because i was also in a same problem and i do not like unfinished work, so a thank you will be enough for the people im helping and a thank you to the people that helped me :)

  • Author

nevermind got it working ty :D

I like helping people because i was also in a same problem and i do not like unfinished work, so a thank you will be enough for the people im helping and a thank you to the people that helped me :)

  • Author

well i used a sound that worked at first but when i edit it to make it shorter and faster this happens everytime i call the sound

 

 

 

2013-07-25 11:32:57 [iNFO] [sTDOUT]     Error setting up audio input stream in method 'initialize'
2013-07-25 11:32:57 [iNFO] [sTDOUT]     ERROR MESSAGE:
2013-07-25 11:32:57 [iNFO] [sTDOUT]         Stream closed
2013-07-25 11:32:57 [iNFO] [sTDOUT]     STACK TRACE:
2013-07-25 11:32:57 [iNFO] [sTDOUT]         java.io.BufferedInputStream.getInIfOpen(Unknown Source)
2013-07-25 11:32:57 [iNFO] [sTDOUT]         java.io.BufferedInputStream.fill(Unknown Source)
2013-07-25 11:32:57 [iNFO] [sTDOUT]         java.io.BufferedInputStream.read(Unknown Source)
2013-07-25 11:32:57 [iNFO] [sTDOUT]         com.sun.media.sound.RIFFReader.read(Unknown Source)
2013-07-25 11:32:57 [iNFO] [sTDOUT]         com.sun.media.sound.RIFFReader.<init>(Unknown Source)
2013-07-25 11:32:57 [iNFO] [sTDOUT]         com.sun.media.sound.WaveFloatFileReader.internal_getAudioFileFormat(Unknown Source)
2013-07-25 11:32:57 [iNFO] [sTDOUT]         com.sun.media.sound.WaveFloatFileReader.getAudioFileFormat(Unknown Source)
2013-07-25 11:32:57 [iNFO] [sTDOUT]         com.sun.media.sound.WaveFloatFileReader.getAudioInputStream(Unknown Source)
2013-07-25 11:32:57 [iNFO] [sTDOUT]         javax.sound.sampled.AudioSystem.getAudioInputStream(Unknown Source)
2013-07-25 11:32:57 [iNFO] [sTDOUT]         paulscode.sound.codecs.CodecWav.initialize(CodecWav.java:128)
2013-07-25 11:32:57 [iNFO] [sTDOUT]         paulscode.sound.libraries.LibraryLWJGLOpenAL.loadSound(LibraryLWJGLOpenAL.java:392)
2013-07-25 11:32:57 [iNFO] [sTDOUT]         paulscode.sound.libraries.LibraryLWJGLOpenAL.newSource(LibraryLWJGLOpenAL.java:640)
2013-07-25 11:32:57 [iNFO] [sTDOUT]         paulscode.sound.SoundSystem.CommandNewSource(SoundSystem.java:1800)
2013-07-25 11:32:57 [iNFO] [sTDOUT]         paulscode.sound.SoundSystem.CommandQueue(SoundSystem.java:2415)
2013-07-25 11:32:57 [iNFO] [sTDOUT]         paulscode.sound.CommandThread.run(CommandThread.java:121)
2013-07-25 11:32:57 [iNFO] [sTDOUT] Error in class 'CodecWav'
2013-07-25 11:32:57 [iNFO] [sTDOUT]     Audio input stream null in method 'readAll'
2013-07-25 11:32:57 [iNFO] [sTDOUT] Error in class 'LibraryLWJGLOpenAL'
2013-07-25 11:32:57 [iNFO] [sTDOUT]     Sound buffer null in method 'loadSound'
2013-07-25 11:32:57 [iNFO] [sTDOUT] Error in class 'LibraryLWJGLOpenAL'
2013-07-25 11:32:57 [iNFO] [sTDOUT]     Source 'sound_12' was not created because an error occurred while loading medieval:fireshot3.wav
2013-07-25 11:32:57 [iNFO] [sTDOUT] Error in class 'LibraryLWJGLOpenAL'
2013-07-25 11:32:57 [iNFO] [sTDOUT]     Source 'sound_12' not found in method 'play'

I like helping people because i was also in a same problem and i do not like unfinished work, so a thank you will be enough for the people im helping and a thank you to the people that helped me :)

  • Author

is it because of the file weight extension bit rate or something?

I like helping people because i was also in a same problem and i do not like unfinished work, so a thank you will be enough for the people im helping and a thank you to the people that helped me :)

Guest
This topic is now closed to further replies.

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.