-
Notifications
You must be signed in to change notification settings - Fork 244
Feature guide: Bossbar
Bars with text on top of the screen originally designed to display health of ender dragon & wither, but plugins found another use for it. In 1.9 mojang added a packet dedicated to displaying text without requiring an entity and allowing customizable color and style as well.
To enable this feature, open config.yml and set
bossbar:
enabled: true
bossbar:
bars:
MyBossbar:
style: "PROGRESS"
color: "%animation:barcolors%"
progress: "100"
text: "&fWebsite: &bwww.domain.com"
Every bossbar line has 4 properties:
Type of bossbar division. Only visible on 1.9+ clients.
You can choose from 5 styles: PROGRESS, NOTCHED_6, NOTCHED_10, NOTCHED_12 and NOTCHED_20
These were defined by mojang, no other options are available. Other plugins using bukkit API to send bossbars may be using different names, but it's the same afterall.
Color of bossbar. Only visible on 1.9+ clients. Old clients will see it purple.
You can choose from 7 colors: BLUE, GREEN, PINK, PURPLE, RED, WHITE and YELLOW
These were defined by mojang, no other options are available.
A number from 0 to 100. Accepts decimals. Using values higher than 100 will result in visual glitch.
If you want to show the progress of a placeholder's value relative to a maximum one, you can use the Math Expansion from PlaceholderAPI and use a placeholder like this one: %math_{placeholder_current_value}/{placeholder_max_value}*100%
or %math_{placeholder_current_value}/<max_value>*100%
if your max value is fixed.
Notes:
Replace the text in between the {}
with the actual placeholder you want to use and <max_value>
with a valid number (i.e. 20).
You cannot use the %placeholder%
format inside the math placeholder.
Example for showing a player's health: %math_{player_health}/20*100%
or %math_{player_health}/{player_max_health}*100%
Text of the bossbar. Length is not limited, supports RGB codes on 1.16+. Does not support newlines.
All 4 properties support placeholders. This includes animations, which can be used to create changing text using a slow animation for example.
In the next example, the bossbar text will switch between the four texts we added in our animation: animations.yml
bossbarText:
change-interval: 10000
texts:
- "&avote.domain.com"
- "&a&nvote.domain.com"
- "&5vote.domain.com"
- "&5&nvote.domain.com"
config.yml
bossbar:
bars:
MyBossbar:
style: "PROGRESS"
color: "BLUE"
progress: "100"
text: "%animation:bossbarText%"
announcement-bar: false
You can also use some level progress placeholder in bossbar progress to make it look even better.
When set to true, the bossbar will not appear by default, only when used in announce command.
bossbar:
bars:
MyBossbar:
style: "PROGRESS"
color: "BLUE"
progress: "100"
text: "Text"
announcement-bar: true #false or undefined means it will be visible all the time
Condition that must be met for player to see the bossbar. Even when using announce command on a bossbar with display condition, players must meet it to see the bossbar. When condition is not defined, bossbar has no requirement to be displayed.
bossbar:
bars:
MyBossbar:
style: "PROGRESS"
color: "BLUE"
progress: "100"
text: "This bossbar is only visible in world 'world'"
display-condition: "%world%=world"
/tab announce bar <name> <time>
name
is name of bossbar defined in bossbar.yml, time
is length of display time in seconds.
When using a bossbar announcement, you have a new placeholder available: %countdown%
that shows remaining time of the announce in seconds.
toggle-command: /bossbar
A command to toggle bossbar visibility for player running the command. This command requires tab.bossbar.toggle
permission.
Note: This command will not appear in command auto-complete, because it's not a real registered command. Registered commands must be defined in plugin jar directly and cannot be dynamic. If you want to solve this, you can try getting a dummy private plugin made which registers that command.
remember-toggle-choice: false
If enabled, disabling bossbar using bossbar-toggle-command
is remembered between reloads and restarts.
hidden-by-default: false
When enabled, bossbar will automatically be hidden until toggle command is used.
bossbar:
disable-in-worlds:
- disabledworld
disable-in-servers:
- disabledserver
To disable the feature in all worlds except listed ones, add WHITELIST
keyword to the list, which will make it a list of enabled worlds / servers instead. Example:
bossbar:
disable-in-worlds:
- WHITELIST
- enabledworld
Note: Disabling in servers is BungeeCord only. To make disabling in worlds work on BungeeCord, install TAB-Bridge plugin on backend servers.
- Will not display at all if TAB is installed on bungeecord (bungeecord is missing entity packets needed to make it work)
- Doesn't offer color and style features.
- Has a visual bug if you set the progress to 50% or less (client sided bug).
- Only one line can be displayed at a time.
- You can see the fog if you don't disable particles in options.
- Text length is limited to 64 characters on <1.7
- May not be visible when looking at blocks
The way of displaying information in bossbar is completely different on 1.8 and 1.9+. Here you can find out why.
Server owners have always been looking for ways to display information. Another way they discovered is by spawning a fake ender dragon / wither, making it invisible, giving it custom name and teleporting it near player. This way, however, has several flaws as you can see above. As of 1.9, mojang decided to add a packet purely for displaying text without requiring an entity. They also added options to set color and style of the bossbar.
With introduction of 1.9 bossbar which is much easier to use, plugins have switched over to that method. However, this feature cannot be used for <1.9 clients as the feature did not exist back then. For this reason you can see some bossbar plugins saying "supports 1.9 and higher", as they don't want to mess with entities.
TAB will attempt to display 1.9 bossbar whenever possible, entity otherwise. 1.9+ clients will always see 1.9 bossbar (even on a 1.8 server thanks to viaversion api). <1.9 clients will see an invisible entity. On bungeecord, however, <1.9 clients won't see anything as bungeecord did not implement entity packets required to make it work.
- Why TAB?
- Installation
- Commands & Permissions
- Frequently Asked Questions
- Compatibility
- How to assign players into groups
- Known issues
- TAB-Bridge plugin
- Belowname
- Bossbar
- Global playerlist
- Header/Footer
- Layout
- Nametags
- Per world playerlist
- Ping spoof
- Playerlist objective
- RedisBungee support
- Scoreboard
- Sorting in tablist
- Spectator fix
- Tablist name formatting
- Animations
- Conditional placeholders
- Error logging
- MySQL
- Placeholder output replacements
- Placeholders
- RGB/font usage
- Client-sided mechanics
- Quick PlaceholderAPI startup guide
- How to setup compatibility with glow plugins
- How to display name from nickname plugins
- How to configure weights in LuckPerms
- How to save config in UTF-8 encoding
- Mini guides collection
- Additional information
- Optimizing plugin's CPU usage
- Developer API