Class BossBarManager
java.lang.Object
net.minestom.server.adventure.bossbar.BossBarManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBossBar(@NotNull Collection<Player> players, @NotNull BossBar bar) Adds the specified players to the boss bar's viewers and spawns the boss bar, registering the boss bar if needed.voidaddBossBar(@NotNull Player player, @NotNull BossBar bar) Adds the specified player to the boss bar's viewers and spawns the boss bar, registering the boss bar if needed.voiddestroyBossBar(@NotNull BossBar bossBar) Completely destroys a boss bar, removing it from all players.@NotNull Collection<Player>getBossBarViewers(@NotNull BossBar bossBar) Gets all the players for whom the given boss bar is currently visible.@NotNull Collection<BossBar>getPlayerBossBars(@NotNull Player player) Gets a collection of all boss bars currently visible to a given player.voidremoveAllBossBars(@NotNull Player player) Removes a player from all of their boss bars.voidremoveBossBar(@NotNull Collection<Player> players, @NotNull BossBar bar) Removes the specified players from the boss bar's viewers and despawns the boss bar.voidremoveBossBar(@NotNull Player player, @NotNull 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
Adds the specified player to the boss bar's viewers and spawns the boss bar, registering the boss bar if needed.- Parameters:
player- the intended viewerbar- the boss bar to show
-
removeBossBar
Removes the specified player from the boss bar's viewers and despawns the boss bar.- Parameters:
player- the intended viewerbar- the boss bar to hide
-
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
public void removeBossBar(@NotNull @NotNull Collection<Player> players, @NotNull @NotNull BossBar bar) 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
-