Boss
endstone.boss
¶
Classes relating to the boss bars that appear at the top of the player's screen.
Classes:
| Name | Description |
|---|---|
BarColor |
Represents the color of a boss bar. |
BarFlag |
Represents an optional flag that changes the appearance or behaviour of a boss bar. |
BarStyle |
Represents the segment style of a boss bar. |
BossBar |
Represents a boss bar that is displayed to players. |
BarColor
¶
BarFlag
¶
Bases: Enum
Represents an optional flag that changes the appearance or behaviour of a boss bar.
Attributes:
| Name | Type | Description |
|---|---|---|
CREATE_FOG |
Creates fog around the world. |
|
DARKEN_SKY |
Darkens the sky like during fighting a wither. |
BarStyle
¶
Bases: Enum
Represents the segment style of a boss bar.
Attributes:
| Name | Type | Description |
|---|---|---|
SEGMENTED_10 |
Splits the boss bar into 10 segments. |
|
SEGMENTED_12 |
Splits the boss bar into 12 segments. |
|
SEGMENTED_20 |
Splits the boss bar into 20 segments. |
|
SEGMENTED_6 |
Splits the boss bar into 6 segments. |
|
SOLID |
Makes the boss bar solid (no segments). |
SEGMENTED_10
class-attribute
instance-attribute
¶
Splits the boss bar into 10 segments.
SEGMENTED_12
class-attribute
instance-attribute
¶
Splits the boss bar into 12 segments.
SEGMENTED_20
class-attribute
instance-attribute
¶
Splits the boss bar into 20 segments.
SEGMENTED_6
class-attribute
instance-attribute
¶
Splits the boss bar into 6 segments.
BossBar
¶
Represents a boss bar that is displayed to players.
Methods:
| Name | Description |
|---|---|
add_flag |
Add an optional flag to this boss bar. |
add_player |
Adds the player to this boss bar causing it to display on their screen. |
has_flag |
Returns whether this boss bar has the passed flag set. |
remove_all |
Removes all players from this boss bar. |
remove_flag |
Remove an existing flag on this boss bar. |
remove_player |
Removes the player from this boss bar causing it to be removed from their screen. |
Attributes:
| Name | Type | Description |
|---|---|---|
color |
BarColor
|
The color of this boss bar. |
is_visible |
bool
|
Whether the boss bar is displayed to attached players. |
players |
list[Player]
|
All players viewing this boss bar. |
progress |
float
|
The progress of the bar between |
style |
BarStyle
|
The style of this boss bar. |
title |
str
|
The title of this boss bar. |
is_visible
property
writable
¶
is_visible: bool
Whether the boss bar is displayed to attached players.
progress
property
writable
¶
progress: float
The progress of the bar between 0.0 and 1.0.
Values should be between 0.0 (empty) and 1.0 (full).
add_flag
¶
add_flag(flag: BarFlag) -> None
Add an optional flag to this boss bar.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
flag
|
BarFlag
|
An optional flag to set on the boss bar. |
required |
add_player
¶
add_player(player: Player) -> None
Adds the player to this boss bar causing it to display on their screen.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
player
|
Player
|
The player to add. |
required |