Minecraft:Commands/dialog
More actions
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
- REDIRECT Template:Code
- Shows a dialog screen from inline SNBT or
- REDIRECT Template:Code
Template:Redr registry (usually defined in a data pack) to specified players.
- REDIRECT Template:Code
- 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
- REDIRECT Template:Command
- Must be either:
- A namespaced ID of a dialog defined in a data pack (e.g.,
custom:my_dialogorminecraft:server_links). These are stored in the
- A namespaced ID of a dialog defined in a data pack (e.g.,
- 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
- To show the nearest player a dialog located at
data/custom/dialog/example/test.jsonin a loaded data pack:/dialog show @p custom:example/test
- To show all players the built-in
minecraft:server_linksdialog:/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
Gallery
-
An example dialog created by ioblackshaw, showcased by xisumavoid on YouTube.<ref>Template:YouTube link</ref>
-
An entity summoner made and shown off by u/SmoothTurtle872 on Reddit
References
<references />
de:Befehl/dialog es:Comandos/dialog ja:コマンド/dialog pt:Comandos/dialog zh:命令/dialog