How to Use the Bossbar Command – Wiki Guide
This Minecraft tutorial explains how to use the /bossbar command with screenshots and step-by-step instructions.
You can use the /bossbar command to add, configure or remove a custom bossbar in Minecraft. Let’s explore how to use this cheat (game command).
Requirements
To run game commands in Minecraft, you have to turn cheats on in your world.
Bossbar Command
Bossbar Command in Minecraft Java Edition (PC/Mac)
In Minecraft Java Edition (PC/Mac), there are different syntaxes depending on what you would like to do with the bossbar.
To add a bossbar:
/bossbar add <id> <name>
To set the text color of the bossbar (default is white):
/bossbar set <id> color <blue¦green¦pink¦purple¦red¦white¦yellow>
To set the maximum value of the bossbar (default is 100):
/bossbar set <id> max <max>
To change the text that appears above the bossbar:
/bossbar set <id> name <name>
To specify which players can see the bossbar (by default, no players can see the bossbar):
/bossbar set <id> players <targets>
To set the style of the bossbar:
/bossbar set <id> style <notched_10¦notched_12¦notched_20¦notched_6¦progress>
To set the current value of the bossbar:
/bossbar set <id> value <value>
To set whether the bossbar is visible (default is true):
/bossbar set <id> visible <true¦false>
To list all bossbars:
/bossbar list
To remove a bossbar:
/bossbar remove <id>
To get an attribute of the bossbar:
/bossbar get <id> <max¦players¦value¦visible>
Definitions
- id is the internal ID to use for the bossbar. It is formatted as
namespace:name
and will default tominecraft:name
if no namespace is provided. - name is the text that will display above the bossbar. This value must be enclosed in quotation marks. For example: “TheChallenge”.
- max is the maximum value of the bossbar. The default is 100.
- targets is the name of the player (or a target selector) that will see the bossbar. By default, no players will see the bossbar, when a new bossbar is created.
- value is the current value of the bossbar. The default is 0.
Examples
Example in Java Edition (PC/Mac)
To create a bossbar called 9Minecraft:bossbar1
with the text “TheChallenge”:
/bossbar add 9Minecraft:bossbar1 "TheChallenge"
To show the bossbar called 9Minecraft:bossbar1
to all players:
/bossbar set 9Minecraft:bossbar1 players @a
To set the current value of the bossbar called 9Minecraft:bossbar1
to 100:
/bossbar set 9Minecraft:bossbar1 value 100
To change the color of the bossbar called 9Minecraft:bossbar1
to yellow:
/bossbar set 9Minecraft:bossbar1 color yellow
To list all bossbars:
/bossbar list
To get the current value of the bossbar called 9Minecraft:bossbar1
:
/bossbar get 9Minecraft:bossbar1 value
To remove the bossbar called 9Minecraft:bossbar1
:
/bossbar remove 9Minecraft:bossbar1
How to Enter the Command
1. Open the Chat Window
The easiest way to run a command in Minecraft is within the chat window. The game control to open the chat window depends on the version of Minecraft:
- For Java Edition (PC/Mac), press the T key to open the chat window.
2. Type the Command
We will cover examples of how to create a bossbar, show the bossbar to players, set the current value of the bossbar, and change the color of the bossbar.
Create a Bossbar
Let’s start by showing how to create a new bossbar that has an ID of 9Minecraft:bossbar1
and “TheChallenge” as the text that appears above the bossbar with the following command:
/bossbar add 9Minecraft:bossbar1 "TheChallenge"
Type the command in the chat window. As you are typing, you will see the command appear in the lower left corner of the game window. Press the Enter key to run the command.
Once the command has been entered, the bossbar will be created but it won’t yet be visible on the screen. By default, no players have been set up to see the bossbar.
Show the Bossbar to Players
Next, let’s update the settings for the bossbar so that the bossbar shows at the top of the game window for all players. We can show the bossbar called 9Minecraft:bossbar1
to all players with the following command:
/bossbar set 9Minecraft:bossbar1 players @a
Type the command and press the Enter key to run the command.
Once the command has been entered, you will see the new bossbar appear at the top of the screen. By default, the color of the bossbar is white, the current value of the bossbar is 0, and the max value of the bossbar is 100.
Set the Current Value of the Bossbar
Now, let’s set the current value of the boss bar to 100 (so that the progress bar is full) with the following command:
/bossbar set 9Minecraft:bossbar1 value 100
Type the command and press the Enter key to run the command.
Once the command has been entered, you should see a full progress bar in white since now the current value for the bossbar is set to 100 and the maximum value for this bossbar is 100.
Change the Color of the Bossbar
Next, let’s change the color of the bossbar to a different color instead of white. You can change the bossbar to blue, green, pink, purple, red, white or yellow.
Let’s change the bossbar to yellow with the following command:
/bossbar set 9Minecraft:bossbar1 color yellow
Type the command and press the Enter key to run the command.
Once the command has been entered, you should see both the bossbar’s text and the progress bar appear in yellow.
Congratulations, you just learned how to use the /bossbar command in Minecraft!