pumpkin-plugin-wit/v0.1/boss-bar.wit
Alexander Medvedev 41d8c71c65 first commit
2026-05-19 17:43:50 +02:00

84 lines
2.6 KiB
Plaintext

interface boss-bar {
use text.{text-component};
use player.{player};
/// Represents the color of a boss bar.
enum boss-bar-color {
pink,
blue,
red,
green,
yellow,
purple,
white,
}
/// Represents the notches/divisions of a boss bar.
enum boss-bar-division {
no-division,
notches-6,
notches-10,
notches-12,
notches-20,
}
/// Metadata flags that can be toggled on a boss bar.
record boss-bar-metadata {
/// Darkens the sky for players who see the boss bar.
darken-sky: bool,
/// If true, the bar is considered a "dragon bar" (used for Ender Dragon).
dragon-bar: bool,
/// If true, fog is created around the players who see the boss bar.
create-fog: bool,
}
/// Represents a boss bar that can be shown to players.
resource boss-bar {
/// Creates a new boss bar.
constructor(title: text-component, color: boss-bar-color, division: boss-bar-division);
/// Returns the title of this boss bar.
get-title: func() -> text-component;
/// Sets the title of this boss bar.
set-title: func(title: text-component);
/// Returns the health (0.0 to 1.0) of this boss bar.
get-health: func() -> f32;
/// Sets the health (0.0 to 1.0) of this boss bar.
set-health: func(health: f32);
/// Returns the color of this boss bar.
get-color: func() -> boss-bar-color;
/// Sets the color of this boss bar.
set-color: func(color: boss-bar-color);
/// Returns the division of this boss bar.
get-division: func() -> boss-bar-division;
/// Sets the division of this boss bar.
set-division: func(division: boss-bar-division);
/// Returns the currently active metadata on this boss bar.
get-metadata: func() -> boss-bar-metadata;
/// Updates the metadata on this boss bar.
set-metadata: func(metadata: boss-bar-metadata);
/// Adds a player to this boss bar, making it visible to them.
add-player: func(player: player);
/// Removes a player from this boss bar, hiding it from them.
remove-player: func(player: player);
/// Returns a list of all players currently seeing this boss bar.
get-players: func() -> list<player>;
/// Removes this boss bar from all players and cleans it up.
remove-all: func();
}
}