Boss Bar - amnoah/BetterScoreboard GitHub Wiki
Creating
Registering
To create a new Boss Bar, we need to add it as a node in the boss-bars.yml file.
Creating Example
Example of how to create a new boss bar:
newbar:
Essential Boss Bar Options
Next, we have to add the following to the boss bar:
weight
This represents how important the bar is. If a player qualifies for 2 bars, one with a weight of 10 and the other with a weight of 11, the bar with a weight of 11 will be shown as it is more important.
This is an integer value.
criteria
To determine whether a player is allowed to have a boss bar displayed, BetterScoreboard uses a placeholder-based system called conditions. You can read more about criteria here.
mode
This determines how the criteria should be handled. You can read more about the mode here.
Essential Boss Bar Options Example
newbar:
weight: 10
criteria:
- "permission:example.permission"
Animations
Adding a Text Animation
Next, add a node called title to the boss bar. The following are options for the text.
random
This option decides whether animation lines should be randomly chosen. If false, they will proceed sequentially.
This is a boolean value.
speed
This value represents how many ticks should pass between animation lines being switched. Set to -1 to disable. Remember that there are 20 ticks in a second.
This is an integer value.
text
This is a list of strings that should be displayed as the title.
These can include placeholders to substitute applicable text into the message.
Adding a Title Animation Example
newbar:
weight: 10
criteria:
- "permission:example.permission"
text:
random: false
speed: 100
text:
- "&1This is a title!"
- "&9This is a title!"
Adding a Color Animation
Next, add a node called color to the boss bar. The following are options for the color.
random
This option decides whether the animation should be randomly chosen. If false, they will proceed sequentially.
This is a boolean value.
speed
This value represents how many ticks should pass between animation steps are switched. Set to -1 to disable. Remember that there are 20 ticks in a second.
This is an integer value.
color
This is a list of strings that should be displayed as the color.
The following are valid options:
pink
blue
red
green
yellow
purple
white
Adding a Color Animation Example
newbar:
weight: 10
criteria:
- "permission:example.permission"
text:
random: false
speed: 100
text:
- "&1This is a title!"
- "&9This is a title!"
color:
random: false
speed: 20
color:
- "green"
- "red"
- "white"
Adding a Division Animation
Next, add a node called division to the boss bar. The following are options for the division.
random
This option decides whether the animation should be randomly chosen. If false, they will proceed sequentially.
This is a boolean value.
speed
This value represents how many ticks should pass between animation steps are switched. Set to -1 to disable. Remember that there are 20 ticks in a second.
This is an integer value.
division
This is a list of integers that represents the division of the bar.
The following are valid options:
1
: The bar will be one complete bar.6
: The bar will have 6 sections.10
: The bar will have 10 sections.12
: The bar will have 12 sections.20
: The bar will have 20 sections.
Adding a Division Animation Example
newbar:
weight: 10
criteria:
- "permission:example.permission"
text:
random: false
speed: 100
text:
- "&1This is a title!"
- "&9This is a title!"
color:
random: false
speed: 20
color:
- "green"
- "red"
- "white"
division:
random: true
speed: 60
division:
- 20
- 1
Adding a Health Animation
Finally, add a node called health to the boss bar. The following are options for the health.
random
This option decides whether the animation should be randomly chosen. If false, they will proceed sequentially.
This is a boolean value.
speed
This value represents how many ticks should pass between animation steps are switched. Set to -1 to disable. Remember that there are 20 ticks in a second.
This is an integer value.
health
This is a list of floats that represent the health of the bar. 1.0 is 100% health, 0 is 0%. Higher and lower values may result in visual glitches, but they will not break the bar itself.
Adding a Health Animation Example
newbar:
weight: 10
criteria:
- "permission:example.permission"
text:
random: false
speed: 100
text:
- "&1This is a title!"
- "&9This is a title!"
color:
random: false
speed: 20
color:
- "green"
- "red"
- "white"
division:
random: true
speed: 60
division:
- 20
- 1
health:
random: false
speed: 5
health:
- 1.0
- 0.75
- 0.5
- 0.25
- 0.0
- 0.25
- 0.5
- 0.75