Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Commands/bossbar: Difference between revisions

From SAS Gaming Wiki
SyncBot (talk | contribs)
Fix template calls: add MC/ prefix
SyncBot (talk | contribs)
Sync: updated from Minecraft
 
Line 1: Line 1:
{{About|the command|the HUD element|Bossbar}}
{{About|the command|the HUD element|Bossbar}}
{{MC/Exclusive|java}}
{{exclusive|java}}
{{Infobox command
{{Infobox command
|name=bossbar
|name=bossbar
Line 9: Line 9:
== Syntax ==
== Syntax ==
:<code>bossbar add <id> <name></code>
:<code>bossbar add <id> <name></code>
::Create a new bossbar (stored in level.dat <code>CustomBossEvents</code>).
::Create a new bossbar (stored in [[Minecraft:Java_Edition_level_format#level.dat_format|level.dat]] <code>CustomBossEvents</code>).
:<code>bossbar get <id> (max|players|value|visible)</code>
:<code>bossbar get <id> (max|players|value|visible)</code>
::Return the requested setting as a <code>result</code> of the command.
::Return the requested setting as a <code>result</code> of the command.
Line 33: Line 33:


== Arguments ==
== Arguments ==
{{MC/Argument|id|resource_location}}
{{argument|id|resource_location}}
: Specifies a unique bossbar.
: Specifies a unique bossbar.
: {{MC/Arg desc|je=resource_location}}
: {{arg desc|je=resource_location}}


{{MC/Argument|name|component}}
{{argument|name|component}}
: Specifies the display name of the bossbar.
: Specifies the display name of the bossbar.
: {{MC/Arg desc|je=component}}
: {{arg desc|je=component}}


{{MC/Argument|max|integer}}
{{argument|max|integer}}
: Specifies the bossbar's maximum value.
: Specifies the bossbar's maximum value.
: {{MC/Arg desc|je=integer|min=1}}
: {{arg desc|je=integer|min=1}}


{{MC/Argument|targets|entity}}
{{argument|targets|entity}}
: Specifies the set of players to whom the bar is visible.
: Specifies the set of players to whom the bar is visible.
: If not specified, the boss bar is invisible to any player.
: If not specified, the boss bar is invisible to any player.
: {{MC/Arg desc|je=entity|amount=multiple|type=players}}
: {{arg desc|je=entity|amount=multiple|type=players}}


{{MC/Argument|value|integer}}
{{argument|value|integer}}
: Specifies the bossbar's current value.
: Specifies the bossbar's current value.
: {{MC/Arg desc|je=integer|min=0}}
: {{arg desc|je=integer|min=0}}


{{MC/Argument|visible|bool}}
{{argument|visible|bool}}
: Specifies the bossbar's visibility.
: Specifies the bossbar's visibility.
: {{MC/Arg desc|je=bool}}
: {{arg desc|je=bool}}


== Result ==
== Result ==
Line 68: Line 68:


== Output ==
== Output ==
{{MC/Output table}}
{{Output table}}
{{MC/Output table|edition=je|On fail|0|0|0}}
{{Output table|edition=je|On fail|0|0|0}}
{{MC/Output table|cmd=/bossbar add ...<br>/bossbar list<br>/bossbar remove ...|On success|1|1|The number of custom bossbars that exist after the command is executed.<br>Bossbars created by the game itself (such as the boss bar of the ender dragon) aren't included.}}
{{Output table|cmd=/bossbar add ...<br>/bossbar list<br>/bossbar remove ...|On success|1|1|The number of custom bossbars that exist after the command is executed.<br>Bossbars created by the game itself (such as the boss bar of the ender dragon) aren't included.}}
{{MC/Output table|cmd=/bossbar get <<nowiki/>id> max<br>/bossbar set <<nowiki/>id> max|On success|1|1|The boss bar's maximum value after the command's execution.}}
{{Output table|cmd=/bossbar get <<nowiki/>id> max<br>/bossbar set <<nowiki/>id> max|On success|1|1|The boss bar's maximum value after the command's execution.}}
{{MC/Output table|cmd=/bossbar get <<nowiki/>id> value<br>/bossbar set <<nowiki/>id> value|On success|1|1|The boss bar's value after execution.}}
{{Output table|cmd=/bossbar get <<nowiki/>id> value<br>/bossbar set <<nowiki/>id> value|On success|1|1|The boss bar's value after execution.}}
{{MC/Output table|cmd=/bossbar get <<nowiki/>id> players<br>/bossbar set <<nowiki/>id> players|On success|1|1|The number of players to whom the bar is visible after execution.}}
{{Output table|cmd=/bossbar get <<nowiki/>id> players<br>/bossbar set <<nowiki/>id> players|On success|1|1|The number of players to whom the bar is visible after execution.}}
{{MC/Output table|cmd=/bossbar get <<nowiki/>id> visible|On success|1|1|1 if the boss bar is visible; otherwise 0.}}
{{Output table|cmd=/bossbar get <<nowiki/>id> visible|On success|1|1|1 if the boss bar is visible; otherwise 0.}}
{{MC/Output table|cmd=/bossbar set <<nowiki/>id> color<br>/bossbar set <<nowiki/>id> name<br>/bossbar set <<nowiki/>id> style<br>/bossbar set <<nowiki/>id> visible|On success|1|1|0}}
{{Output table|cmd=/bossbar set <<nowiki/>id> color<br>/bossbar set <<nowiki/>id> name<br>/bossbar set <<nowiki/>id> style<br>/bossbar set <<nowiki/>id> visible|On success|1|1|0}}
{{MC/Output table}}
{{Output table}}


== History ==
== History ==
{{HistoryTable
{{HistoryTable
|{{MC/HistoryLine|java}}
|{{HistoryLine|java}}
|{{HistoryLine||1.13|dev=18w05a|Added {{MC/Cd|/bossbar}}.}}
|{{HistoryLine||1.13|dev=18w05a|Added {{cd|/bossbar}}.}}
|{{HistoryLine||1.21.5|dev=25w05a|Text component arguments are now resolved before use in context of entity held in {{MC/Cd|@s}}.}}
|{{HistoryLine||1.21.5|dev=25w05a|Text component arguments are now resolved before use in context of entity held in {{cd|@s}}.}}
}}
}}


== Navigation ==
== Navigation ==
{{MC/Navbox commands}}
{{Navbox commands}}


de:Befehl/bossbar
[[Minecraft:de:Befehl/bossbar]]
es:Comandos/bossbar
[[Minecraft:es:Comandos/bossbar]]
ja:コマンド/bossbar
[[Minecraft:fr:Commandes/bossbar]]
pt:Comandos/bossbar
[[Minecraft:ja:コマンド/bossbar]]
ru:Команды консоли/bossbar
[[Minecraft:pt:Comandos/bossbar]]
uk:Команди консолі/bossbar
[[Minecraft:ru:Команды консоли/bossbar]]
zh:命令/bossbar
[[Minecraft:uk:Команди консолі/bossbar]]
[[Minecraft:zh:命令/bossbar]]

Latest revision as of 11:07, 1 July 2026

Template:Exclusive Template:Infobox command Creates, modifies and lists bossbars.

Syntax

bossbar add <id> <name>
Create a new bossbar (stored in level.dat CustomBossEvents).
bossbar get <id> (max|players|value|visible)
Return the requested setting as a result of the command.
bossbar list
Display a list of existing bossbars.
bossbar remove <id>
Remove an existing bossbar.
bossbar set <id> (color|max|name|players|style|value|visible)
... color (blue|green|pink|purple|red|white|yellow)
Set the text color (if no color was specified as part of a text component) and bar color. Defaults to white upon creation.
... max <max>
Set the bossbar's maximum value. Defaults to 100 upon creation.
... name <name>
Set the bossbar's name.
... players [<targets>]
Change the set of players to whom the bar is visible. Defaults to none upon creation.
... style (notched_6|notched_10|notched_12|notched_20|progress)
Set the bossbar's visual amount of segments: continuous, 6 segments, 10 segments, 12 segments, or 20 segments. Defaults to progress upon creation.
... value <value>
Set the bossbar's current value. Defaults to 0 upon creation.
... visible <visible>
Set the bossbar's visibility. Defaults to true upon creation.

Arguments

Template:Argument

Specifies a unique bossbar.
Template:Arg desc

Template:Argument

Specifies the display name of the bossbar.
Template:Arg desc

Template:Argument

Specifies the bossbar's maximum value.
Template:Arg desc

Template:Argument

Specifies the set of players to whom the bar is visible.
If not specified, the boss bar is invisible to any player.
Template:Arg desc

Template:Argument

Specifies the bossbar's current value.
Template:Arg desc

Template:Argument

Specifies the bossbar's visibility.
Template:Arg desc

Result

Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table

Output

Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table

History

Template:HistoryTable

Navigation

Template:Navbox commands

Minecraft:de:Befehl/bossbar Minecraft:es:Comandos/bossbar Minecraft:fr:Commandes/bossbar Minecraft:ja:コマンド/bossbar Minecraft:pt:Comandos/bossbar Minecraft:ru:Команды консоли/bossbar Minecraft:uk:Команди консолі/bossbar Minecraft:zh:命令/bossbar