Skip to content
WikilyWIKILY
All games23 Wikis · pick your game
Commands and cheatsAll commands

Switch game

23 Wikis · pick your game
/bossbar

Command

/bossbar

Creates and controls custom boss bars shown at the top of players' screens.

Syntax

/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)

Arguments

ArgumentKind of valueWhat to type
<id>IdThe namespaced id of the boss bar, for example example:raid. Without a namespace, minecraft: is used.
<name>Text componentThe display name as a text component, for example "Raid Progress" or {text:"Raid Progress",color:"red"}.
<max>Whole numberThe maximum value of the bar. A whole number of 1 or more. At least 1.
<targets>Target selectorThe players who should see the bar. Optional for set players: leaving it out clears the list. One or more players.
<value>Whole numberThe current value of the bar. A whole number of 0 or more. At least 0.
<visible>True or falsetrue to show the bar, false to hide it.

Details

Permission level2: operators, worlds with cheats on, command blocks and functions
Works inSingleplayer with cheats enabled and multiplayer servers. Needs permission level 2 (gamemasters): server operators, players with cheats, command blocks, and functions can all run it.
ResultEach 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.
addCreates 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.
removeDeletes the boss bar and removes it from every player's screen.
listLists all custom boss bars, or says there are none.
getReads one property of a boss bar: value, max, visible, or players (the players on the bar who are currently online).
set value and set maxChange 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 colorChanges the bar color to blue, green, pink, purple, red, white, or yellow.
set styleChanges 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 nameChanges the text shown above the bar.
set playersReplaces the list of players who see the bar. Without a player argument, the bar is removed from everyone.
set visibleShows or hides the bar for its players without deleting it.
Nothing changedEvery 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.

Examples

/bossbar add example:raid "Raid Progress"

Creates a boss bar named Raid Progress.

/bossbar set example:raid players @a

Shows the boss bar to all players who are online.

/bossbar set example:raid value 50

Fills the bar halfway when the maximum is 100.

/bossbar set example:raid color red

Turns the bar red.

/bossbar set example:raid style notched_10

Splits the bar into 10 segments.

/bossbar remove example:raid

Deletes the boss bar.

Join the creator communityThe people who build the Minecraft Java Edition wiki are on our Discord. Ask questions or suggest pages.Join Discord (opens Discord in a new tab)