Started by
The Average Gamer
on
Topic category: User side tutorials
So I have some epic boss music that I want to play when a boss is alive and stop when he is dead. Is there any way I can do this?
Topic category: User side tutorials
So I have some epic boss music that I want to play when a boss is alive and stop when he is dead. Is there any way I can do this?
In the mob procedure section, you can have a procedure that executes when the mob first spawns. For your procedure, you can find the play sound block in the world management section. However, I don't know if there is a way to stop or replay your music once the boss is killed, or if they aren't killed yet.
Oh, you also have to go to resources/sound files and import your epic boss music.
Here's how one could use boss music when it comes to mobs, both start and stop.
On initial mob spawn
- Use this block:
If it's a custom sound, I believe the sound is played based on what category it is in, such as master, ambient, player, neutral, hostile, block, record, and music.
When mob dies
- There's not necessarily an official stopsound block, however you could use this block:
and use this command:
This should work for what you want to have happen, but I could be wrong.
oh my god thats useful for me too
How i Put the block in initial mob spawn
its not a block its a trigger in the mob mod element
how do i make the music loop? Since it just stops at one point
first, you have to know how many seconds long your song is. in minecraft, one second = 20 ticks, so multiply the song length in seconds by 20, so <song length> × 20.
heres an example:
song length = 3:21 minutes ÷ 60 = 201 seconds
201 seconds × 20 = 4020 ticks
now you know how many ticks your song plays for, so you can now use the [wait <ticks> , then on server-side:] block to trigger the song again. you should also put an if-statement to check if the boss is still alive.