onyx.bossbar
- class onyx.bossbar.Bossbar(id, display_name=None, create=False)
Bossbar - An object representing a bossbar
- Parameters
id (str) – The ID of the bossbar
display_name (TextComponent, optional) – The display name of the bossbar. Defaults to None.
create (bool, optional) – Whether or not the bossbar should be created on initalization. Defaults to False.
- get(query_type)
get - Gets an attribute of the bossbar
- Parameters
query_type (bossbar_query) – What attribute of the bossbar to get
- Returns
Command
- Return type
str
- remove()
remove - Deletes the bossbar
- Returns
Command
- Return type
str
- set_color(color)
set_color - Set the color attribute of the bossbar
- Parameters
color (bossbar_color) – The new color of the bossbar
- Returns
Command
- Return type
str
- set_max_value(value)
set_max_value - Sets the max value attribute of the bossbar
- Parameters
value (int) – The new max value of the bossbar
- Returns
Command
- Return type
str
- set_name(display_name)
set_name - Sets the display name (the text at the top) of the bossbar
- Parameters
display_name (TextComponent) – The new display name of the bossbar
- Returns
Command
- Return type
str
- set_players(players)
set_players - Sets the players the bossbar is shown to
- Parameters
players (Selector) – The players the bossbar is visible to
- Returns
Command
- Return type
str
- set_style(style)
set_style - Sets the style of the the bossbar
- Parameters
style (bossbar_style) – The new style of the bossbar
- Returns
Command
- Return type
str
- set_value(value)
set_value - Sets the value (how filled) of the bossbar
- Parameters
value (int) – The new value
- Returns
Command
- Return type
str
- set_visibility(visibility)
set_visibility - Sets whether or not the bossbar can be seen at all
- Parameters
visibility (bool) – Whether or not the bossbar is visible
- Returns
Command
- Return type
str