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

From SAS Gaming Wiki
SyncBot (talk | contribs)
Remove broken links to missing pages
SyncBot (talk | contribs)
Fix template calls: add MC/ prefix
 
Line 1: Line 1:
{{Distinguish|/dialogue}}
{{MC/Distinguish|/dialogue}}
{{Exclusive|java}}
{{MC/Exclusive|java}}
{{Infobox command
{{Infobox command
| name = dialog
| name = dialog
Line 10: Line 10:


==Syntax==
==Syntax==
: {{cd|/dialog show <targets> <dialog>}}
: {{MC/Cd|/dialog show <targets> <dialog>}}
:: Shows a dialog screen from inline SNBT or {{cd|minecraft:dialog}} registry (usually defined in a data pack) to specified players.
:: Shows a dialog screen from inline SNBT or {{MC/Cd|minecraft:dialog}} registry (usually defined in a data pack) to specified players.
: {{cd|/dialog clear <targets>}}
: {{MC/Cd|/dialog clear <targets>}}
:: Clears currently displayed dialogs for specified players.
:: Clears currently displayed dialogs for specified players.


==Arguments==
==Arguments==
{{argument|targets|entity}}
{{MC/Argument|targets|entity}}
: Specifies the players whose dialog is shown or cleared.
: Specifies the players whose dialog is shown or cleared.
: {{arg desc|je=entity|amount=multiple|type=players}}
: {{MC/Arg desc|je=entity|amount=multiple|type=players}}


{{argument|dialog|dialog}}
{{MC/Argument|dialog|dialog}}
: Specifies the dialog to show to the players. This argument is only used with {{cmd|link=none|dialog show}}.
: Specifies the dialog to show to the players. This argument is only used with {{MC/Cmd|link=none|dialog show}}.
: Must be either:
: Must be either:
:* A namespaced ID of a dialog defined in a data pack (e.g., {{code|custom:my_dialog}} or {{code|minecraft:server_links}}). These are stored in the {{cd|minecraft:dialog}} registry.
:* A namespaced ID of a dialog defined in a data pack (e.g., {{MC/Code|custom:my_dialog}} or {{MC/Code|minecraft:server_links}}). These are stored in the {{MC/Cd|minecraft:dialog}} registry.
:* An inline SNBT defining the dialog structure directly in the command. See {{slink|Dialog|Dialog format}} for the structures.
:* An inline SNBT defining the dialog structure directly in the command. See {{slink|Dialog|Dialog format}} for the structures.


Line 29: Line 29:
{{Result table|onlyje=1}}
{{Result table|onlyje=1}}
{{Result table|The command is incomplete, or any argument is not specified correctly.|unparseable}}
{{Result table|The command is incomplete, or any argument is not specified correctly.|unparseable}}
{{Result table|cmd=/dialog (show{{!}}clear) <targets>|{{cd|targets}} is a target selector that includes any entities other than the player.|fail}}
{{Result table|cmd=/dialog (show{{!}}clear) <targets>|{{MC/Cd|targets}} is a target selector that includes any entities other than the player.|fail}}
{{Result table|cmd=/dialog show <targets> <dialog>|{{cd|dialog}} is not a valid dialog SNBT, or dialog does not exist in {{cd|minecraft:dialog}} registry (usually in a data pack).|fail}}
{{Result table|cmd=/dialog show <targets> <dialog>|{{MC/Cd|dialog}} is not a valid dialog SNBT, or dialog does not exist in {{MC/Cd|minecraft:dialog}} registry (usually in a data pack).|fail}}
{{Result table|cmd=|succeed}}
{{Result table|cmd=|succeed}}
{{Result table}}
{{Result table}}


== 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}}
{{MC/Output table}}


==Examples==
==Examples==
Line 60: Line 60:
== History ==
== History ==
{{HistoryTable
{{HistoryTable
|{{HistoryLine|java}}
|{{MC/HistoryLine|java}}
|{{HistoryLine||1.21.6|dev=25w20a|Added {{command|dialog|link=none}}|Added {{code|minecraft:custom_options}} and {{code|minecraft:server_links}} as blank built-in dialogs.}}
|{{HistoryLine||1.21.6|dev=25w20a|Added {{MC/Command|dialog|link=none}}|Added {{MC/Code|minecraft:custom_options}} and {{MC/Code|minecraft:server_links}} as blank built-in dialogs.}}
|{{HistoryLine|||dev=Pre-Release 1|Added {{code|minecraft:quick_actions}} as a blank built-in dialog.}}
|{{HistoryLine|||dev=Pre-Release 1|Added {{MC/Code|minecraft:quick_actions}} as a blank built-in dialog.}}
}}
}}


Line 75: Line 75:


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


de:Befehl/dialog
de:Befehl/dialog

Latest revision as of 20:09, 9 April 2026

Template:Hatnote Script error: No such module "Exclusive". Template:Infobox command

Manages dialog screens displayed to players. Allows server operators to show custom or predefined dialogs in data pack to specified players, and clear any displayed dialogs on their screen.

Syntax

  1. REDIRECT Template:Code

Template:Redr

Shows a dialog screen from inline SNBT or
  1. REDIRECT Template:Code

Template:Redr registry (usually defined in a data pack) to specified players.

  1. REDIRECT Template:Code

Template:Redr

Clears currently displayed dialogs for specified players.

Arguments

<targets>: entity

Specifies the players whose dialog is shown or cleared.
{{#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|}}

<dialog>: dialog

Specifies the dialog to show to the players. This argument is only used with
  1. REDIRECT Template:Command

Template:Redr.

Must be either:
  • A namespaced ID of a dialog defined in a data pack (e.g., custom:my_dialog or minecraft:server_links). These are stored in the
  1. REDIRECT Template:Code

Template:Redr registry.

  • An inline SNBT defining the dialog structure directly in the command. See Template:Slink for the structures.

Result

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: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

File:Dialog simple confirmation.png
A simple confirmation dialog from an example.
File:Dialog command execution confirmation.png
Pressing "Yes" results in a command execution, which requires a confirmation from the player.
  • To show the nearest player a dialog located at data/custom/dialog/example/test.json in a loaded data pack:
    /dialog show @p custom:example/test
  • To show all players the built-in minecraft:server_links dialog:
    /dialog show @a minecraft:server_links
  • To show nearest players a notice dialog with title "Hello" and an "Ok" button in the footer:
    /dialog show @p {type:"minecraft:notice",title:"Hello"}
  • To show all players a simple confirmation dialog with two action buttons with the label "Yes please" and "Nope". If the player presses "Yes please", the game runs a command to give the player a Minecraft:diamond, otherwise, if they press "Nope", the game closes the dialog:
    /dialog show @a {type:"minecraft:confirmation",title:"Give yourself diamond?",yes:{label:"Yes please","action":{"type":"run_command","command":"give @s diamond"}},no:{label:"Nope"}}
  • To clear any currently visible dialogs for all players:
    /dialog clear @a

History

Template:HistoryTable

Gallery

References

<references />

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/dialog es:Comandos/dialog ja:コマンド/dialog pt:Comandos/dialog zh:命令/dialog