Hello, I was wondering if anyone could help me in utilizing the different colored boss bars. When a new ender dragon is spawned I want to remove the default purple health bar from the top of the screen and add in a colored one with a custom name. The main problem I'm facing is removing the default health bar. And future problems I can see arising are linking the enderdragon's health with the new boss bar. Thanks in advance
I've read that but my main problem is getting the original BossBar of the dragon and removing it. There's no EnderDragon.getBossBar() or anything.
@SiezureSalad I see, i just saw it here: https://hub.spigotmc.org/javadocs/b...r.html#removePlayer-org.bukkit.entity.Player- but oh well. :/ Sorry that i'm not able to help.
Yeah that's what I would use but I need to somehow get the actual Object of the BossBar so I can apply that method to it.
@SiezureSalad Have you tried something like this?: Code:Java BossBar whatever = //Create bossbarwhatever.removePlayer(player); EDIT: I tried doing this and it didn't come with any errors. (Didn't test in-game tho)
I don't have a problem with creating a new BossBar. When you spawn an ender dragon you get the purple bossbar at the top of your screen saying Ender Dragon, I wan't to remove players from this so that players can't see it.
Could you not do a for loop getting all the players on the server then do #removePlayer(player) CODE (Move your mouse to reveal the content) CODE (open) CODE (close) Code: for(Player p : Bukkit.getServer().getOnlinePlayers()){ bar.removePlayer(p); }
@NullPointerExptn I think the problem is that he can't get the boss bar from the EnderDragon's boss bar when it's summoned, not the bar he created so therefore that wouldn't work.