Skip to content

Boss

endstone.boss

Classes relating to the boss bars that appear at the top of the player's screen.

Classes:

Name Description
BarColor
BarFlag
BarStyle
BossBar

Represents a boss bar that is displayed to players.

BarColor

Bases: Enum

Attributes:

Name Type Description
BLUE
GREEN
PINK
PURPLE
REBECCA_PURPLE
RED
WHITE
YELLOW

BLUE class-attribute instance-attribute

BLUE = 1

GREEN class-attribute instance-attribute

GREEN = 3

PINK class-attribute instance-attribute

PINK = 0

PURPLE class-attribute instance-attribute

PURPLE = 5

REBECCA_PURPLE class-attribute instance-attribute

REBECCA_PURPLE = 6

RED class-attribute instance-attribute

RED = 2

WHITE class-attribute instance-attribute

WHITE = 7

YELLOW class-attribute instance-attribute

YELLOW = 4

BarFlag

Bases: Enum

Attributes:

Name Type Description
CREATE_FOG

Creates fog around the world.

DARKEN_SKY

Darkens the sky like during fighting a wither.

CREATE_FOG class-attribute instance-attribute

CREATE_FOG = 1

Creates fog around the world.

DARKEN_SKY class-attribute instance-attribute

DARKEN_SKY = 0

Darkens the sky like during fighting a wither.

BarStyle

Bases: Enum

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

SEGMENTED_10 = 2

Splits the boss bar into 10 segments

SEGMENTED_12 class-attribute instance-attribute

SEGMENTED_12 = 3

Splits the boss bar into 12 segments

SEGMENTED_20 class-attribute instance-attribute

SEGMENTED_20 = 4

Splits the boss bar into 20 segments

SEGMENTED_6 class-attribute instance-attribute

SEGMENTED_6 = 1

Splits the boss bar into 6 segments

SOLID class-attribute instance-attribute

SOLID = 0

Makes the boss bar solid (no segments)

BossBar

Represents a boss bar that is displayed to players.

Methods:

Name Description
add_flag

Adds 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

Checks whether this boss bar has the passed flag set.

remove_all

Removes all players from this boss bar.

remove_flag

Removes 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

If the boss bar is displayed to attached players.

players list[Player]

Returns all players viewing this boss bar.

progress float

The progress of the bar between 0.0 and 1.0.

style BarStyle

The style of this boss bar.

title str

The title of this boss bar.

color property writable

color: BarColor

The color of this boss bar.

is_visible property writable

is_visible: bool

If the boss bar is displayed to attached players.

players property

players: list[Player]

Returns all players viewing this boss bar.

progress property writable

progress: float

The progress of the bar between 0.0 and 1.0.

style property writable

style: BarStyle

The style of this boss bar.

title property writable

title: str

The title of this boss bar.

add_flag

add_flag(flag: BarFlag) -> None

Adds an optional flag to this boss bar.

add_player

add_player(player: Player) -> None

Adds the player to this boss bar causing it to display on their screen.

has_flag

has_flag(flag: BarFlag) -> bool

Checks whether this boss bar has the passed flag set.

remove_all

remove_all() -> None

Removes all players from this boss bar.

remove_flag

remove_flag(flag: BarFlag) -> None

Removes an existing flag on this boss bar.

remove_player

remove_player(player: Player) -> None

Removes the player from this boss bar causing it to be removed from their screen.