Skip to content

bossbar

BossBar

Python
BossBar(
    bar_uuid: str,
    title: str,
    health: float,
    color: int,
    division: int,
    flags: int,
)

Minecraft Boss Bar representation and packet parser.

ATTRIBUTE DESCRIPTION
uuid

Unique identifier for this boss bar

TYPE: str

title

Current display title

TYPE: str

health

Current health value (0.0 to 1.0)

TYPE: float

color

Current color ID (0-6) - 0: Pink, 1: Blue, 2: Red, 3: Green, 4: Yellow, 5: Purple, 6: White

TYPE: int

division

Current division type (0-4) - 0: No division, 1: 6 notches, 2: 10 notches, 3: 12 notches, 4: 20 notches

TYPE: int

flags

Current flag bits - 0x1: Darken sky, 0x2: Dragon bar (plays end music)

TYPE: int

health_percentage

Python
health_percentage() -> int

Get health as percentage.

RETURNS DESCRIPTION
int

Health value as percentage (0-100)

darken_sky

Python
darken_sky() -> bool

Check if sky darkening is enabled.

RETURNS DESCRIPTION
bool

True if darken sky.

is_dragon_bar

Python
is_dragon_bar() -> bool

Check if this is a dragon boss bar.

RETURNS DESCRIPTION
bool

True if dragon bar flag (0x2) is set

is_visible

Python
is_visible() -> bool

Check if boss bar should be visible.

RETURNS DESCRIPTION
bool

True if health is greater than 0