Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.8] Turning off minecraft background music (from code)


Slashpwn
 Share

Recommended Posts

Hi guys,

 

So I'm developing an adaptive music player for a school project. I got most of the stuff working but I can't figure out how to stop the vanilla minecraft music.

I found a similar project and I suspect they used this method:

 

@SubscribeEvent

public void onBackgroundMusic(PlayBackgroundMusicEvent event) {

if(SongLoader.enabled)

event.setCanceled(false);

}

 

But this doesn't work, since PlayBackgroundMusicEvent is "@Deprecated".

 

Do you guys know any other method?

 

 

Many thanks,

Slashpwn

 

Link to comment
Share on other sites

What version of minecraft are you on? also, if you haven't already, you'll want to add an @SubscribeEvent on whatever function stops the music.

- Just because things are the way they are doesn't mean they can't be the way you want them to be. Unless they're aspen trees. You can tell they're aspens 'cause the way they are.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.