BossBar API
The BossBar API allows you to create server-sided boss health bars to display information, progress, or events to players on the screen.
1. Creating a BossBar
use potato_api::bossbar::{BossBar, BarColor, BarStyle};
use potato_api::text::Component;
let bar = BossBar::new(
Component::from_mini_message("<red><b>Server Restarting</b></red>"),
BarColor::Red,
BarStyle::Solid
);
bar.set_progress(1.0); // 100% full2. Managing Viewers
// Show it to a specific player
bar.add_player(player);
// Later, remove the player
bar.remove_player(player);
// Or show to all players currently online
for p in context.server().online_players() {
bar.add_player(p);
}