Posted January 19, 201411 yr Hey guys, I have a problem playing custom sounds. I follow VSWEs tutorials on youtube. When I call Minecraft.getMinecraft().sndManager.playSound("example:wand", (float)x, (float)y, (float)z, volume, pitch); the SoundSystem-thread throws a NullPointerException. I register the sound in this class @SideOnly(Side.CLIENT) public class SoundHandler { @ForgeSubscribe public void onSoundsLoad(SoundLoadEvent event) { event.manager.soundPoolSounds.addSound("example:wand.ogg"); } } the file is in assets/example/sound/wand.ogg and I register my SoundHandler in my proxy on the client side only. MinecraftForge.EVENT_BUS.register(new SoundHandler()); this is the full errormessage 2014-01-19 21:49:02 [information] [sTDERR] Exception in thread "Thread-7" java.lang.NullPointerException 2014-01-19 21:49:02 [information] [sTDERR] at paulscode.sound.codecs.CodecJOrbis.readHeader(CodecJOrbis.java:448) 2014-01-19 21:49:02 [information] [sTDERR] at paulscode.sound.codecs.CodecJOrbis.initialize(CodecJOrbis.java:301) 2014-01-19 21:49:02 [information] [sTDERR] at paulscode.sound.libraries.LibraryLWJGLOpenAL.loadSound(LibraryLWJGLOpenAL.java:392) 2014-01-19 21:49:02 [information] [sTDERR] at paulscode.sound.libraries.LibraryLWJGLOpenAL.newSource(LibraryLWJGLOpenAL.java:640) 2014-01-19 21:49:02 [information] [sTDERR] at paulscode.sound.SoundSystem.CommandNewSource(SoundSystem.java:1800) 2014-01-19 21:49:02 [information] [sTDERR] at paulscode.sound.SoundSystem.CommandQueue(SoundSystem.java:2415) 2014-01-19 21:49:02 [information] [sTDERR] at paulscode.sound.CommandThread.run(CommandThread.java:121) I hope you guys can help me
January 19, 201411 yr Minecraft.getMinecraft().sndManager.playSound("example:wand", (float)x, (float)y, (float)z, volume, pitch); OH GOD WHY. Use this: par1World.playSoundEffect(x, y, z, "example:wand", volume, pitch); event.manager.soundPoolSounds.addSound("example:wand.ogg"); Try: event.manager.addSound("example:wand.ogg"); Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
January 19, 201411 yr Author Thank you for the quick response. Unfortunately, the error is still there.
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.