Minecraft:Commands/bossbar: Difference between revisions
More actions
Remove broken links to missing pages |
Fix template calls: add MC/ prefix |
||
| Line 1: | Line 1: | ||
{{About|the command|the HUD element|Bossbar}} | {{About|the command|the HUD element|Bossbar}} | ||
{{ | {{MC/Exclusive|java}} | ||
{{Infobox command | {{Infobox command | ||
|name=bossbar | |name=bossbar | ||
| Line 33: | Line 33: | ||
== Arguments == | == Arguments == | ||
{{ | {{MC/Argument|id|resource_location}} | ||
: Specifies a unique bossbar. | : Specifies a unique bossbar. | ||
: {{ | : {{MC/Arg desc|je=resource_location}} | ||
{{ | {{MC/Argument|name|component}} | ||
: Specifies the display name of the bossbar. | : Specifies the display name of the bossbar. | ||
: {{ | : {{MC/Arg desc|je=component}} | ||
{{ | {{MC/Argument|max|integer}} | ||
: Specifies the bossbar's maximum value. | : Specifies the bossbar's maximum value. | ||
: {{ | : {{MC/Arg desc|je=integer|min=1}} | ||
{{ | {{MC/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}} | ||
{{ | {{MC/Argument|value|integer}} | ||
: Specifies the bossbar's current value. | : Specifies the bossbar's current value. | ||
: {{ | : {{MC/Arg desc|je=integer|min=0}} | ||
{{ | {{MC/Argument|visible|bool}} | ||
: Specifies the bossbar's visibility. | : Specifies the bossbar's visibility. | ||
: {{ | : {{MC/Arg desc|je=bool}} | ||
== Result == | == Result == | ||
| Line 68: | Line 68: | ||
== Output == | == Output == | ||
{{Output table}} | {{MC/Output table}} | ||
{{Output table|edition=je|On fail|0|0|0}} | {{MC/Output table|edition=je|On fail|0|0|0}} | ||
{{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 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 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> 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> 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> 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> 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> 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> visible|On success|1|1|1 if the boss bar is visible; otherwise 0.}} | {{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 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|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}} | {{MC/Output table}} | ||
== History == | == History == | ||
{{HistoryTable | {{HistoryTable | ||
|{{HistoryLine|java}} | |{{MC/HistoryLine|java}} | ||
|{{HistoryLine||1.13|dev=18w05a|Added {{ | |{{HistoryLine||1.13|dev=18w05a|Added {{MC/Cd|/bossbar}}.}} | ||
|{{HistoryLine||1.21.5|dev=25w05a|Text component arguments are now resolved before use in context of entity held in {{ | |{{HistoryLine||1.21.5|dev=25w05a|Text component arguments are now resolved before use in context of entity held in {{MC/Cd|@s}}.}} | ||
}} | }} | ||
== Navigation == | == Navigation == | ||
{{Navbox commands}} | {{MC/Navbox commands}} | ||
de:Befehl/bossbar | de:Befehl/bossbar | ||
Latest revision as of 20:08, 9 April 2026
|
For the {{{Description}}} of the same name, see [[{{{Destination}}}]]. |
Script error: No such module "Exclusive". Template:Infobox command Creates, modifies and lists bossbars.
Syntax
bossbar add <id> <name>- Create a new bossbar (stored in level.dat
CustomBossEvents).
- Create a new bossbar (stored in level.dat
bossbar get <id> (max|players|value|visible)- Return the requested setting as a
resultof the command.
- Return the requested setting as a
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
whiteupon creation.
- Set the text color (if no color was specified as part of a text component) and bar color. Defaults to
... max <max>- Set the bossbar's maximum value. Defaults to
100upon creation.
- Set the bossbar's maximum value. Defaults to
... 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
progressupon creation.
- Set the bossbar's visual amount of segments: continuous, 6 segments, 10 segments, 12 segments, or 20 segments. Defaults to
... value <value>- Set the bossbar's current value. Defaults to
0upon creation.
- Set the bossbar's current value. Defaults to
... visible <visible>- Set the bossbar's visibility. Defaults to
trueupon creation.
- Set the bossbar's visibility. Defaults to
Arguments
<id>: resource_location
- Specifies a unique bossbar.
- {{#vardefine:onlyje|}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|resource_location}}{{#vardefine:be-arg|}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
<name>: component
- Specifies the display name of the bossbar.
- {{#vardefine:onlyje|}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|component}}{{#vardefine:be-arg|}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
<max>: integer
- Specifies the bossbar's maximum value.
- {{#vardefine:onlyje|}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|integer}}{{#vardefine:be-arg|}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
<targets>: entity
- Specifies the set of players to whom the bar is visible.
- If not specified, the boss bar is invisible to any player.
- {{#vardefine:onlyje|}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|entity}}{{#vardefine:be-arg|}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
<value>: integer
- Specifies the bossbar's current value.
- {{#vardefine:onlyje|}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|integer}}{{#vardefine:be-arg|}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
<visible>: bool
- Specifies the bossbar's visibility.
- {{#vardefine:onlyje|}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|bool}}{{#vardefine:be-arg|}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
Result
Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table
Output
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-table-lines|-2}}{{#vardefine:output-table-lines-now|}}{{#vardefine:command-num-now|}}{{#vardefine:command-line-now|}}{{#vardefine:commands-num|}}{{#vardefine:output-edition-num-now|}}{{#vardefine:output-edition-line-now|}}{{#vardefine:output-editions-num|}}{{#vardefine:je-outputs-dis|}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On fail}}{{#vardefine:output1-{{#var:output-table-lines}}|0}}{{#vardefine:output2-{{#var:output-table-lines}}|0}}{{#vardefine:output3-{{#var:output-table-lines}}|0}}{{#vardefine:command-row-{{#var:commands-num}}|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-editions-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-{{#var:output-editions-num}}|je}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|1}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|1}}{{#vardefine:output3-{{#var:output-table-lines}}|The number of custom bossbars that exist after the command is executed.
Bossbars created by the game itself (such as the boss bar of the ender dragon) aren't included.}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|/bossbar add ...}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|1}}{{#vardefine:output3-{{#var:output-table-lines}}|The boss bar's maximum value after the command's execution.}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|
/bossbar list
/bossbar remove .../bossbar get <id> max}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|1}}{{#vardefine:output3-{{#var:output-table-lines}}|The boss bar's value after execution.}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|
/bossbar set <id> max/bossbar get <id> value}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|1}}{{#vardefine:output3-{{#var:output-table-lines}}|The number of players to whom the bar is visible after execution.}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|
/bossbar set <id> value/bossbar get <id> players}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|1}}{{#vardefine:output3-{{#var:output-table-lines}}|1 if the boss bar is visible; otherwise 0.}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|
/bossbar set <id> players/bossbar get <id> visible}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|1}}{{#vardefine:output3-{{#var:output-table-lines}}|0}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|/bossbar set <id> color}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}}
/bossbar set <id> name
/bossbar set <id> style
/bossbar set <id> visible
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-table-lines|-2}}{{#vardefine:output-table-lines-now|}}{{#vardefine:command-num-now|}}{{#vardefine:command-line-now|}}{{#vardefine:commands-num|}}{{#vardefine:output-edition-num-now|}}{{#vardefine:output-edition-line-now|}}{{#vardefine:output-editions-num|}}{{#vardefine:je-outputs-dis|}}
History
de:Befehl/bossbar es:Comandos/bossbar ja:コマンド/bossbar pt:Comandos/bossbar ru:Команды консоли/bossbar uk:Команди консолі/bossbar zh:命令/bossbar