Posted October 28, 201510 yr Hello, so i was about to add custom background music to my new dimension although I noticed that all the sound events where deprecated. is there one that is actually usable?
October 28, 201510 yr Author Alright, thank you for the heads up and the quick reply. I'll see what I can cook up in my crazy meth lab.
October 29, 201510 yr Author So, instead of using a tick event i used the onLivingUpdate event where it just checks if the player is in the dimension and if it is then it starts playing the music. this resulted in no errors although in game its acting kind of weird. Even though I have no code checking for if the player is in a gui the music only seems to play when its in the menu gui (escape button)
October 29, 201510 yr Author Still haven't solved the sound playing in the escape button menu.. this is literally all the code im using for it: if(ent.dimension == ARMain.dimensionId) { if(!ent.worldObj.isRemote) { ent.worldObj.playSound(ent.posX, ent.posY, ent.posZ, "annoyingrodents:icarusBackground", 1, 1, true); } }
October 29, 201510 yr Still haven't solved the sound playing in the escape button menu.. this is literally all the code im using for it: if(ent.dimension == ARMain.dimensionId) { if(!ent.worldObj.isRemote) { ent.worldObj.playSound(ent.posX, ent.posY, ent.posZ, "annoyingrodents:icarusBackground", 1, 1, true); } } Sounds are client side. When you call playSound on server, it just notifies clients. Also, this method is used to play positioned sound (not music). Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones
October 29, 201510 yr Author Still haven't solved the sound playing in the escape button menu.. this is literally all the code im using for it: if(ent.dimension == ARMain.dimensionId) { if(!ent.worldObj.isRemote) { ent.worldObj.playSound(ent.posX, ent.posY, ent.posZ, "annoyingrodents:icarusBackground", 1, 1, true); } } so what would be your advice of doing it? I mean the only way to play sound/music that I knew of were the sound events and these playsound methods in the world class. Sounds are client side. When you call playSound on server, it just notifies clients. Also, this method is used to play positioned sound (not music).
October 30, 201510 yr Adding music and sounds is done via json lists. No hacking needed. I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
October 30, 201510 yr Author Adding music and sounds is done via json lists. No hacking needed. Oh no, its not about adding them to the game. It is about actually playing one as background music in my dimension.
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.