Started by
bigburgerkittnt
on
Topic category: Help with Minecraft modding (Java Edition)
I am making a boss with a fail state where if the player fighting it dies, its theme stops playing and it despawns. I was able to get the rest to work by making it fail the fight if no players are in a certain radius, however, since the mob gets unloaded when the player dies and respawns far away, the effects (most importantly the music stop) do not happen until the player gets back to the boss. How can I execute the music stopping command before this? (The boss indirectly kills the player with falling blocks and other mobs, so I don't think I can use the "kills an entity" trigger) I also tried to /forceload the boss's chunks and it did not work.
Could you maybe have the player be more responsible for the music?
Like I don't know how you've set this up. But you could maybe set like a nbt tag or a global variable on the player (when that boss fight starts), that is checked occasionally for whether the music should play.
And then when the player respawns reset that variable/tag.