Posted September 18, 201411 yr Hey, i would like to play a background music on my mod It works great with these following method: this.mc.thePlayer.playSound("magiccrusade:luan_hong", 1, 1); ... this.mc.theWorld.playSound(...) this.mc.theWorld.playSoundAtEntity(...) ... ... but the sound is play only at the given location, and not "in background" I don't find how to play "in background" (just like minecraft vanilla musics), does anyone has a solution? I've also searched on LWJGL library but i can't make it work Thank you (i hope my english wasn't too bad)
September 18, 201411 yr Hi After rummaging through MusicTicker, I think you might be able to achieve it using ISound.AttenuationType = NONE, see MovingSoundMinecartRiding constructor for a vanilla example, also PositionedSoundRecord public static PositionedSoundRecord func_147673_a(ResourceLocation p_147673_0_) { return new PositionedSoundRecord(p_147673_0_, 1.0F, 1.0F, false, 0, ISound.AttenuationType.NONE, 0.0F, 0.0F, 0.0F); } -TGG
September 18, 201411 yr Author Yes awesome! I've just searched in these classes and find this solution ^^ This code works great: this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147673_a(new ResourceLocation("magiccrusade:luan_hong"))); Thank you!!
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.