Class BossBarManager
java.lang.Object
net.minestom.server.adventure.bossbar.BossBarManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBossBar(Collection<Player> players, BossBar bar) Adds the specified players to the boss bar's viewers and spawns the boss bar, registering the boss bar if needed.voidaddBossBar(Player player, BossBar bar) Adds the specified player to the boss bar's viewers and spawns the boss bar, registering the boss bar if needed.voiddestroyBossBar(BossBar bossBar) Completely destroys a boss bar, removing it from all players.getBossBarViewers(BossBar bossBar) Gets all the players for whom the given boss bar is currently visible.getPlayerBossBars(Player player) Gets a collection of all boss bars currently visible to a given player.voidremoveAllBossBars(Player player) Removes a player from all of their boss bars.voidremoveBossBar(Collection<Player> players, BossBar bar) Removes the specified players from the boss bar's viewers and despawns the boss bar.voidremoveBossBar(Player player, BossBar bar) Removes the specified player from the boss bar's viewers and despawns the boss bar.
-
Constructor Details
-
BossBarManager
public BossBarManager()Creates a new boss bar manager.- See Also:
-
-
Method Details
-
addBossBar
-
removeBossBar
-
addBossBar
Adds the specified players to the boss bar's viewers and spawns the boss bar, registering the boss bar if needed.- Parameters:
players- the playersbar- the boss bar
-
removeBossBar
Removes the specified players from the boss bar's viewers and despawns the boss bar.- Parameters:
players- the intended viewersbar- the boss bar to hide
-
destroyBossBar
Completely destroys a boss bar, removing it from all players.- Parameters:
bossBar- the boss bar
-
removeAllBossBars
Removes a player from all of their boss bars. Note that this method does not send any removal packets to the player. It is meant to be used when a player is disconnecting from the server.- Parameters:
player- the player
-
getPlayerBossBars
Gets a collection of all boss bars currently visible to a given player.- Parameters:
player- the player- Returns:
- the boss bars
-
getBossBarViewers
Gets all the players for whom the given boss bar is currently visible.- Parameters:
bossBar- the boss bar- Returns:
- the players
-