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/title: Difference between revisions

From SAS Gaming Wiki
imported>MinecraftBedrockPlayer7
mNo edit summary
 
SyncBot (talk | contribs)
Fix template calls: add MC/ prefix
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{redirect|Title|the title screen|Title Screen}}
{{MC/Redirect|Title|the title screen|Title Screen}}
{{Infobox command
{{Infobox command
|name=title
|name=title
Line 5: Line 5:
* 2 {{only|java|short=1}}
* 2 {{only|java|short=1}}
* 1 {{only|bedrock|short=1}}
* 1 {{only|bedrock|short=1}}
|others=[[Minecraft:Cheat]] only{{only|bedrock|short=1}}
|others=Cheat only{{only|bedrock|short=1}}
}}
}}


Line 12: Line 12:
== Usage ==
== Usage ==
[[File:Title command.png|thumb|Example result of the title command.]]
[[File:Title command.png|thumb|Example result of the title command.]]
A screen title is displayed to players as a single line of large center-aligned text in the middle of their displays, and can include a subtitle; a second, separate line of text displayed just below the title. Text can also be printed to the [[Minecraft:action bar]], the space just above the player's [[Minecraft:hotbar]].  
A screen title is displayed to players as a single line of large center-aligned text in the middle of their displays, and can include a subtitle; a second, separate line of text displayed just below the title. Text can also be printed to the action bar, the space just above the player's hotbar.  


{{IN|java}}, all of them are specified using [[Minecraft:Raw JSON text format|text components]]. {{IN|bedrock}}, the <code>/title</code> command uses plain text while <code>/titleraw</code> uses raw JSON text components.
{{MC/In|java}}, all of them are specified using text components. {{MC/In|bedrock}}, the <code>/title</code> command uses plain text while <code>/titleraw</code> uses raw JSON text components.


Screen titles can be set to fade in and fade out, and the duration they are displayed can also be specified. Screen titles scale in size with the GUI Scale, and screen titles that are too big to fit on the screen are not line-wrapped (they just overflow off the screen on both sides). Note that the "fadeIn", "stay", and "fadeOut" values of each player are only sent to their own client side rather than stored in the server side. For a client, these values are cross-save and cross-server. These values are reset only when the client restarts, and the default is 10 game ticks (0.5 seconds), 70 game ticks (3.5 seconds), and 20 game ticks (1 second).
Screen titles can be set to fade in and fade out, and the duration they are displayed can also be specified. Screen titles scale in size with the GUI Scale, and screen titles that are too big to fit on the screen are not line-wrapped (they just overflow off the screen on both sides). Note that the "fadeIn", "stay", and "fadeOut" values of each player are only sent to their own client side rather than stored in the server side. For a client, these values are cross-save and cross-server. These values are reset only when the client restarts, and the default is 10 game ticks (0.5 seconds), 70 game ticks (3.5 seconds), and 20 game ticks (1 second).


{{IN|be}}, the opacity of the black background of the title can be adjusted with the "Text Background Opacity" option in the [[Minecraft:Options#Accessibility|accessibility settings]].
{{MC/In|be}}, the opacity of the black background of the title can be adjusted with the "Text Background Opacity" option in the accessibility settings.


==Syntax==
==Syntax==
Line 52: Line 52:
==Arguments==
==Arguments==


{{argument|targets|entity|target: target|CommandSelector<Player>}}
{{MC/Argument|targets|entity|target: target|CommandSelector<Player>}}
: Specifies the player(s) to display a screen title to.
: Specifies the player(s) to display a screen title to.
: {{arg desc|je=entity|amount=multiple|type=players|be=player}}
: {{MC/Arg desc|je=entity|amount=multiple|type=players|be=player}}


{{el|je|short=1}}: {{argument|title|component}}<br>
{{MC/El|je|short=1}}: {{MC/Argument|title|component}}<br>
{{el|be|short=1}}: {{argument|be=1|titleText: message|CommandMessage}} or {{argument|be=1|raw json titleText: json|Json::Value}}
{{MC/El|be|short=1}}: {{MC/Argument|be=1|titleText: message|CommandMessage}} or {{MC/Argument|be=1|raw json titleText: json|Json::Value}}
: Specifies the text to display as a title, subtitle, or on the action bar.
: Specifies the text to display as a title, subtitle, or on the action bar.
: {{IN|java}}, {{lcfirst:{{arg desc|je=component}}}}
: {{MC/In|java}}, {{lcfirst:{{MC/Arg desc|je=component}}}}
: {{IN|bedrock}},
: {{MC/In|bedrock}},
:* For <code>titleText: message</code>, {{lcfirst:{{arg desc|be=CommandMessage}}}}
:* For <code>titleText: message</code>, {{lcfirst:{{MC/Arg desc|be=CommandMessage}}}}
:* for <code>raw json titleText: json</code>, {{lcfirst:{{arg desc|be=Json::Value}}}}
:* for <code>raw json titleText: json</code>, {{lcfirst:{{MC/Arg desc|be=Json::Value}}}}


{{el|je|short=1}}: {{argument|fadeIn|time}}, {{argument|stay|time}} and {{argument|fadeOut|time}}<br>
{{MC/El|je|short=1}}: {{MC/Argument|fadeIn|time}}, {{MC/Argument|stay|time}} and {{MC/Argument|fadeOut|time}}<br>
{{el|be|short=1}}: {{argument|be=1|fadeIn: int|int}}, {{argument|be=1|stay: int|int}}, and {{argument|be=1|fadeOut: int|int}}
{{MC/El|be|short=1}}: {{MC/Argument|be=1|fadeIn: int|int}}, {{MC/Argument|be=1|stay: int|int}}, and {{MC/Argument|be=1|fadeOut: int|int}}
: Specifies the time for the screen title to fade in, stay, and fade out. {{IN|bedrock}}, it's specified in [[Minecraft:Tick|game tick]]s (1/20ths of a second), and values below 0 are treated as 0.
: Specifies the time for the screen title to fade in, stay, and fade out. {{MC/In|bedrock}}, it's specified in [[Minecraft:Tick|game tick]]s (1/20ths of a second), and values below 0 are treated as 0.
: {{arg desc|je=time|min=0|be=int}}
: {{MC/Arg desc|je=time|min=0|be=int}}


==Result==
==Result==
{{Result table}}
{{Result table}}
{{Result table|The command is incomplete, or any argument is not specified correctly.|unparseable|unparseable}}
{{Result table|The command is incomplete, or any argument is not specified correctly.|unparseable|unparseable}}
{{Result table|<code>raw json message: json</code> is not a [[Minecraft:raw JSON text]].|N/A|fail}}
{{Result table|<code>raw json message: json</code> is not a raw JSON text.|N/A|fail}}
{{Result table|<code>player: target</code> is a target selector that is not in [[Minecraft:Target selectors#Player type and single type|player type]].}}
{{Result table|<code>player: target</code> is a target selector that is not in [[Minecraft:Target selectors#Player type and single type|player type]].}}
{{Result table|<code><targets></code> or <code>player: target</code> fails to resolve to one or more online players.|fail}}
{{Result table|<code><targets></code> or <code>player: target</code> fails to resolve to one or more online players.|fail}}
Line 80: Line 80:
== 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|On success|1|1|the number of targeted players}}
{{MC/Output table|On success|1|1|the number of targeted players}}
{{Output table|edition=be|On fail|0}}
{{MC/Output table|edition=be|On fail|0}}
{{Output table|On success|the number of targeted players}}
{{MC/Output table|On success|the number of targeted players}}
{{Output table}}
{{MC/Output table}}


==Examples==
==Examples==
Line 91: Line 91:
All of the following displays a bold screen title "Chapter I" with a gray italic subtitle "The story begins…" to all players.
All of the following displays a bold screen title "Chapter I" with a gray italic subtitle "The story begins…" to all players.


*{{IN|java}}:
*{{MC/In|java}}:
*# <code>/title @a subtitle {"text": "The story begins...", "color": "gray", "italic": true}</code>
*# <code>/title @a subtitle {"text": "The story begins...", "color": "gray", "italic": true}</code>
*# <code>/title @a title {"text": "Chapter I", "bold": true}</code>
*# <code>/title @a title {"text": "Chapter I", "bold": true}</code>
*{{IN|bedrock}} using plain text:
*{{MC/In|bedrock}} using plain text:
*#<code>/title @a subtitle §7§oThe story begins...</code>
*#<code>/title @a subtitle §7§oThe story begins...</code>
*#<code>/title @a title §lChapter I</code>
*#<code>/title @a title §lChapter I</code>
*{{IN|bedrock}} with raw text variants:
*{{MC/In|bedrock}} with raw text variants:
*#<code>/titleraw @a subtitle {"rawtext": [{"text":"§7§oThe story begins..."}]}</code>
*#<code>/titleraw @a subtitle {"rawtext": [{"text":"§7§oThe story begins..."}]}</code>
*#<code>/titleraw @a title {"rawtext": [{"translate":"§lChapter %%s","with":["I"]}]}</code>
*#<code>/titleraw @a title {"rawtext": [{"translate":"§lChapter %%s","with":["I"]}]}</code>


== History ==
== History ==
{{missing info|/titleraw's history}}
{{MC/Missing info|/titleraw's history}}


=== ''Java Edition'' ===
=== ''Java Edition'' ===
{{HistoryTable
{{HistoryTable
|{{HistoryLine|java}}
|{{MC/HistoryLine|java}}
|{{HistoryLine||1.8|dev=14w20a|Added {{cmd|title|link=none}}.}}
|{{HistoryLine||1.8|dev=14w20a|Added {{MC/Cmd|title|link=none}}.}}
|{{HistoryLine||1.11|dev=16w32b|Added the ability for {{cmd|title|link=none}} to display text in the action bar position.}}
|{{HistoryLine||1.11|dev=16w32b|Added the ability for {{MC/Cmd|title|link=none}} to display text in the action bar position.}}
|{{HistoryLine||1.19.4|dev=22w03a|Now {{cmd|title|link=none}} uses time [[Minecraft:argument types]] rather than integer.
|{{HistoryLine||1.19.4|dev=22w03a|Now {{MC/Cmd|title|link=none}} uses time [[Minecraft:argument types]] rather than integer.
|Before this snapshot, these integer arguments specifies a time in game ticks.}}
|Before this snapshot, these integer arguments specifies a time in game ticks.}}
|{{HistoryLine||1.21.5|dev=25w02a|Text Components are now specified with SNBT instead of JSON.}}
|{{MC/HistoryLine||1.21.5|dev=25w02a|Text Components are now specified with SNBT instead of JSON.}}
}}
}}


=== ''Bedrock Edition'' ===
=== ''Bedrock Edition'' ===
{{HistoryTable
{{HistoryTable
|{{HistoryLine|pocket}}
|{{MC/HistoryLine|pocket}}
|{{HistoryLine||1.0.5|dev=alpha 1.0.5.0|Added {{cmd|title|link=none}}.}}  
|{{HistoryLine||1.0.5|dev=alpha 1.0.5.0|Added {{MC/Cmd|title|link=none}}.}}  
}}
}}
<gallery>
<gallery>
Line 130: Line 130:


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


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

Latest revision as of 20:14, 9 April 2026

Template:Hatnote Template:Infobox command

Controls text displayed on the screen.

Usage

File:Title command.png
Example result of the title command.

A screen title is displayed to players as a single line of large center-aligned text in the middle of their displays, and can include a subtitle; a second, separate line of text displayed just below the title. Text can also be printed to the action bar, the space just above the player's hotbar.

in Template:Editions, all of them are specified using text components. in Template:Editions, the /title command uses plain text while /titleraw uses raw JSON text components.

Screen titles can be set to fade in and fade out, and the duration they are displayed can also be specified. Screen titles scale in size with the GUI Scale, and screen titles that are too big to fit on the screen are not line-wrapped (they just overflow off the screen on both sides). Note that the "fadeIn", "stay", and "fadeOut" values of each player are only sent to their own client side rather than stored in the server side. For a client, these values are cross-save and cross-server. These values are reset only when the client restarts, and the default is 10 game ticks (0.5 seconds), 70 game ticks (3.5 seconds), and 20 game ticks (1 second).

in Template:Editions, the opacity of the black background of the title can be adjusted with the "Text Background Opacity" option in the accessibility settings.

Syntax

  • Java Edition
title <targets> (clear|reset)
title <targets> (title|subtitle|actionbar) <title>
title <targets> times <fadeIn> <stay> <fadeOut>
  • Bedrock Edition (plain text)
title <player: target> <clear|reset>
title <player: target> <title|subtitle|actionbar> <titleText: message>
title <player: target> times <fadeIn: int> <stay: int> <fadeOut: int>
  • Bedrock Edition (JSON)
titleraw <player: target> <clear|reset>
titleraw <player: target> <titleLocation: TileRawSet> <raw json titleText: json>
titleraw <player: target> times <fadeIn: int> <stay: int> <fadeOut: int>

Detail

... clear
Clears the screen title from the screens of the specified player(s).
... reset
Resets the subtitle text for the specified player(s) to blank text, and the fade-in, stay and fade-out times to their default values (defaults to 10 gt, 70 gt, and 20 gt).
... subtitle ...
If a screen title is currently being displayed to the specified player(s), changes the current subtitle to the specified text; otherwise, specifies the subtitle for the next screen title to be displayed to the specified player(s).
... title ...
Displays a screen title to the specified player(s), or changes the current screen title to the specified text. After fading out, resets the subtitle back to blank text, but does not reset fade-in, stay, and fade-out times.
... actionbar ...
Displays text on the action bar to the specified player(s), or changes the current action bar title.
... times ...
Changes the fade-in, stay, and fade-out times (measured in time durations) of all current and future screen titles for the specified player(s).

Arguments

Template:El<targets>: entity
Template:El: target: target: CommandSelector<Player>

Specifies the player(s) to display a screen title to.
{{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|entity}}{{#vardefine:be-arg|entity}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
  1. REDIRECT Template:Edition

Template:Rcat: <title>: component

  1. REDIRECT Template:Edition

Template:Rcat: titleText: message: CommandMessage or raw json titleText: json: Json::Value

Specifies the text to display as a title, subtitle, or on the action bar.
in Template:Editions, {{#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|}}
in Template:Editions,
  • For titleText: message, {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|message}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
  • for raw json titleText: json, {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|component}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
  1. REDIRECT Template:Edition

Template:Rcat: <fadeIn>: time, <stay>: time and <fadeOut>: time

  1. REDIRECT Template:Edition

Template:Rcat: fadeIn: int: int, stay: int: int, and fadeOut: int: int

Specifies the time for the screen title to fade in, stay, and fade out. in Template:Editions, it's specified in game ticks (1/20ths of a second), and values below 0 are treated as 0.
{{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|time}}{{#vardefine:be-arg|integer}}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 targeted players}}{{#vardefine:command-row-{{#var:commands-num}}|Expression error: Unrecognized punctuation character "{".}}{{#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 fail}}{{#vardefine:output1-{{#var:output-table-lines}}|0}}{{#vardefine:output2-{{#var:output-table-lines}}|N/A}}{{#vardefine:output3-{{#var:output-table-lines}}|N/A}}{{#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}}|be}}{{#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}}|the number of targeted players}}{{#vardefine:output2-{{#var:output-table-lines}}|N/A}}{{#vardefine:output3-{{#var:output-table-lines}}|N/A}}{{#vardefine:command-row-{{#var:commands-num}}|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}}

{{#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|}}

Examples

All of the following displays a bold screen title "Chapter I" with a gray italic subtitle "The story begins…" to all players.

  • in Template:Editions:
    1. /title @a subtitle {"text": "The story begins...", "color": "gray", "italic": true}
    2. /title @a title {"text": "Chapter I", "bold": true}
  • in Template:Editions using plain text:
    1. /title @a subtitle §7§oThe story begins...
    2. /title @a title §lChapter I
  • in Template:Editions with raw text variants:
    1. /titleraw @a subtitle {"rawtext": [{"text":"§7§oThe story begins..."}]}
    2. /titleraw @a title {"rawtext": [{"translate":"§lChapter %%s","with":["I"]}]}

History

  1. REDIRECT Template:Missing information

Template:Redr

Java Edition

Template:HistoryTable

Bedrock Edition

Template:HistoryTable

External links

Navigation

All editions
Removed
Template:El only
Debug
Removed
Template:Els only
Template:El only
Removed
Template:El only
Removed
Template:Els only
Removed
Joke
Related

de:Befehl/title ja:コマンド/title pt:Comandos/title ru:Команды консоли/title zh:命令/title