
Command
/bossbar
Creates and controls custom boss bars shown at the top of players' screens.
| /bossbar add <id> <name> |
| /bossbar get <id> (max|players|value|visible) |
| /bossbar list |
| /bossbar remove <id> |
| /bossbar set <id> color (blue|green|pink|purple|red|white|yellow) |
| /bossbar set <id> (max <max>|name <name>|value <value>|visible <visible>) |
| /bossbar set <id> players [<targets>] |
| /bossbar set <id> style (notched_10|notched_12|notched_20|notched_6|progress) |
| Argument | Kind of value | What to type |
|---|---|---|
| <id> | Id | The namespaced id of the boss bar, for example example:raid. Without a namespace, minecraft: is used. |
| <name> | Text component | The display name as a text component, for example "Raid Progress" or {text:"Raid Progress",color:"red"}. |
| <max> | Whole number | The maximum value of the bar. A whole number of 1 or more. At least 1. |
| <targets> | Target selector | The players who should see the bar. Optional for set players: leaving it out clears the list. One or more players. |
| <value> | Whole number | The current value of the bar. A whole number of 0 or more. At least 0. |
| <visible> | True or false | true to show the bar, false to hide it. |
| Permission level | 2: operators, worlds with cheats on, command blocks and functions |
| Works in | Singleplayer with cheats enabled and multiplayer servers. Needs permission level 2 (gamemasters): server operators, players with cheats, command blocks, and functions can all run it. |
| Result | Each sub-command reports what it did. Numeric results: add and remove return the number of boss bars that exist afterwards, list returns the number of boss bars, get value and get max return that number, get visible returns 1 or 0, get players and set players return the number of players on the bar, set value and set max return the new number, and the other set commands return 0. |
| add | Creates a new boss bar with the given id and display name. It starts with a value of 0, a maximum of 100, the color white, the style progress, visible, and with no players, so nobody sees it until players are set. Fails if a boss bar with that id already exists. |
| remove | Deletes the boss bar and removes it from every player's screen. |
| list | Lists all custom boss bars, or says there are none. |
| get | Reads one property of a boss bar: value, max, visible, or players (the players on the bar who are currently online). |
| set value and set max | Change the current value and the maximum. The bar is filled by value divided by max, and it is shown full if the value is larger than the maximum. The maximum must be at least 1 and the value at least 0. |
| set color | Changes the bar color to blue, green, pink, purple, red, white, or yellow. |
| set style | Changes how the bar is divided: progress is one solid bar, and notched_6, notched_10, notched_12, and notched_20 split it into that many segments. |
| set name | Changes the text shown above the bar. |
| set players | Replaces the list of players who see the bar. Without a player argument, the bar is removed from everyone. |
| set visible | Shows or hides the bar for its players without deleting it. |
| Nothing changed | Every set command fails with a "Nothing changed" message if the bar already has that setting. Any command that names a boss bar fails if no bar with that id exists. |
/bossbar add example:raid "Raid Progress"Creates a boss bar named Raid Progress.
/bossbar set example:raid players @aShows the boss bar to all players who are online.
/bossbar set example:raid value 50Fills the bar halfway when the maximum is 100.
/bossbar set example:raid color redTurns the bar red.
/bossbar set example:raid style notched_10Splits the bar into 10 segments.
/bossbar remove example:raidDeletes the boss bar.

