📊Bossbar Builder
Creates bossbars for the player
Overview
The BossBarBuilder
class simplifies the creation and management of boss bars for players in a Minecraft Bukkit server environment. It provides methods for setting the title, color, style, progress, and flags of boss bars, as well as creating and updating boss bars for individual players.
Constructor
BossBarBuilder
BossBarBuilder
Initializes a new instance of the BossBarBuilder
class with the specified JavaPlugin instance.
Parameters
plugin
: The JavaPlugin instance associated with the boss bar builder.
Methods
setTitle
setTitle
Sets the title of the boss bar.
setColor
setColor
Sets the color of the boss bar.
setStyle
setStyle
Sets the style of the boss bar.
setProgress
setProgress
Sets the progress (percentage filled) of the boss bar.
setFlags
setFlags
Sets the flags of the boss bar.
create
create
Creates a boss bar for the specified player with the configured properties.
Parameters
player
: The player for whom the boss bar is created.
update
update
Updates the boss bar for the specified player with the current configuration.
Parameters
player
: The player whose boss bar is updated.
Notes
The
BossBarBuilder
class allows for the creation and management of dynamic boss bars to provide players with visual indicators or progress trackers.Developers can configure various properties of the boss bar, including title, color, style, progress, and flags, to suit different gameplay scenarios.
Boss bars created using this builder pattern can be easily updated to reflect changes in player status or game events.
Last updated