Boss Bars
The OOP module wraps Minecraft boss bars into a simple config + handle pattern.
This is useful when you want one place to configure a bar and then reuse it across multiple gameplay functions.
BossBarConfig stores the initial registration settings, while BossBarHandle exposes the runtime commands you call from functions.
Registering a boss bar
A load function is generated that creates the bar and applies all initial settings.
Typical workflow
In practice, boss bars often pair well with timers, boss fights, or round-based activities where the bar is configured once and then updated from several different functions.
Manipulating a boss bar
You can also target all members of a team:
Configuration vs handle methods
BossBarConfig controls the values that are written when the bar is registered:
colordisplayNamemaxstylevaluevisible
BossBarHandle exposes the runtime methods listed below.
Function reference
| Function | Description |
|---|---|
hide |
Hide the bar without deleting its configuration |
remove |
Remove the boss bar entirely |
setColor |
Change the boss bar color |
setMax |
Update the maximum value used to render progress |
setName |
Change the displayed boss bar name |
setPlayers(entity) |
Control which players currently see the bar |
setPlayers(team) |
Show the bar to every member of a team |
setStyle |
Change the boss bar rendering style |
setValue |
Update the current boss bar value |
show |
Make the bar visible to the assigned players |
