Implementing Boss FIght Music

Started by Crusader Gladiator on

Topic category: Mod ideas exchange

Last seen on 21:26, 23. Apr 2024
Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Implementing Boss FIght Music

Any Idea on how to add boss fight music.

Last seen on 10:38, 22. Apr 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It's possible, but tricky. I…
Sun, 04/07/2024 - 19:13

It's possible, but tricky. I did something like this for my music mod, and I could share some of the code with ya if you're interested.

The basic idea is that you need a song that can be split up into modular parts. Minecraft's sound system doesn't allow you to fade music in or out, meaning the bossfight either has to be exactly the duration of the song, or you need to play multiple snippets of a song at set intervals when the bossfight is active, in such a way that they string together into one song. Needless to say, this is kind of complicated, and a bit of a headache to get working properly.

But yeah, you need to use a player-persistent variable as a timer between segments of the song, need to be aware of what segments can be strung together, and need to cut to the end segment when the boss is defeated, or the player is out of range. You will also likely want to cancel all other music sfx when the boss battle starts.