Minecraft:Commands/dialog: Difference between revisions
From SAS Gaming Wiki
More actions
Fix template calls: add MC/ prefix |
Sync: updated from Minecraft |
||
| Line 1: | Line 1: | ||
{{ | {{Distinguish|/dialogue}} | ||
{{ | {{Exclusive|java}} | ||
{{Infobox command | {{Infobox command | ||
| name = dialog | | name = dialog | ||
| Line 7: | Line 7: | ||
}} | }} | ||
Manages dialog screens displayed to | Manages [[Minecraft:dialog]] screens displayed to [[Minecraft:player]]s. Allows server [[Minecraft:operator]]s to show custom or predefined dialogs in [[Minecraft:data pack]] to specified players, and clear any displayed dialogs on their screen. | ||
==Syntax== | ==Syntax== | ||
: {{ | : {{cd|/dialog show <targets> <dialog>}} | ||
:: Shows a dialog screen from inline SNBT or {{ | :: Shows a dialog screen from inline [[Minecraft:SNBT]] or {{cd|minecraft:dialog}} registry (usually defined in a [[Minecraft:data pack]]) to specified players. | ||
: {{ | : {{cd|/dialog clear <targets>}} | ||
:: Clears currently displayed dialogs for specified players. | :: Clears currently displayed dialogs for specified players. | ||
==Arguments== | ==Arguments== | ||
{{ | {{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}} | ||
{{ | {{argument|dialog|dialog}} | ||
: Specifies the dialog to show to the players. This argument is only used with {{ | : Specifies the dialog to show to the players. This argument is only used with {{cmd|link=none|dialog show}}. | ||
: | : {{arg desc|je=dialog}} | ||
:* A namespaced ID of a dialog defined in a data pack (e.g., {{ | <!--:* 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. | ||
:* An inline SNBT defining the dialog structure directly in the command. See {{slink|Dialog|Dialog format}} for the structures. | :* An inline [[Minecraft:SNBT]] defining the dialog structure directly in the command. See {{slink|Dialog|Dialog format}} for the structures.--> | ||
==Result== | ==Result== | ||
{{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>|{{ | {{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 <targets> <dialog>|{{ | {{Result table|cmd=/dialog show <targets> <dialog>|{{cd|dialog}} is not a valid dialog [[Minecraft:SNBT]], or dialog does not exist in {{cd|minecraft:dialog}} registry (usually in a [[Minecraft:data pack]]).|fail}} | ||
{{Result table|cmd=|succeed}} | {{Result table|cmd=|succeed}} | ||
{{Result table}} | {{Result table}} | ||
== Output == | == Output == | ||
{{ | {{Output table}} | ||
{{ | {{Output table|edition=je|On fail|0|0|0}} | ||
{{ | {{Output table|On success|1|1|the number of targeted players}} | ||
{{ | {{Output table}} | ||
==Examples== | ==Examples== | ||
| Line 49: | Line 49: | ||
*:<code>/dialog show @a minecraft:server_links</code> | *:<code>/dialog show @a minecraft:server_links</code> | ||
* To show nearest players a notice dialog with title "Hello" and an "Ok" button in the footer: | * To show nearest players a [[Minecraft:Dialog#notice|notice dialog]] with title "Hello" and an "Ok" button in the footer: | ||
*:<code>/dialog show @p {type:"minecraft:notice",title:"Hello"}</code> | *:<code>/dialog show @p {type:"minecraft:notice",title:"Hello"}</code> | ||
* 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: | * To show all players a simple [[Minecraft:Dialog#confirmation|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: | ||
*:<code>/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"}}</code> | *:<code>/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"}}</code> | ||
| Line 60: | Line 60: | ||
== History == | == History == | ||
{{HistoryTable | {{HistoryTable | ||
|{{ | |{{HistoryLine|java}} | ||
|{{HistoryLine||1.21.6|dev=25w20a|Added {{ | |{{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|||dev=Pre-Release 1|Added {{ | |{{HistoryLine|||dev=Pre-Release 1|Added {{code|minecraft:quick_actions}} as a blank built-in dialog.}} | ||
}} | }} | ||
| Line 75: | Line 75: | ||
== Navigation == | == Navigation == | ||
{{ | {{Navbox commands}} | ||
de:Befehl/dialog | [[Minecraft:de:Befehl/dialog]] | ||
es:Comandos/dialog | [[Minecraft:es:Comandos/dialog]] | ||
ja:コマンド/dialog | [[Minecraft:ja:コマンド/dialog]] | ||
pt:Comandos/dialog | [[Minecraft:pt:Comandos/dialog]] | ||
zh:命令/dialog | [[Minecraft:zh:命令/dialog]] | ||
Latest revision as of 11:17, 9 August 2026
Template:Distinguish Template:Exclusive Template:Infobox command
Manages Minecraft:dialog screens displayed to Minecraft:players. Allows server Minecraft:operators to show custom or predefined dialogs in Minecraft:data pack to specified players, and clear any displayed dialogs on their screen.
Syntax
- Template:Cd
- Shows a dialog screen from inline Minecraft:SNBT or Template:Cd registry (usually defined in a Minecraft:data pack) to specified players.
- Template:Cd
- Clears currently displayed dialogs for specified players.
Arguments
- Specifies the players whose dialog is shown or cleared.
- Template:Arg desc
- Specifies the dialog to show to the players. This argument is only used with Template:Cmd.
- Template:Arg desc
Result
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
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 />
Minecraft:de:Befehl/dialog Minecraft:es:Comandos/dialog Minecraft:ja:コマンド/dialog Minecraft:pt:Comandos/dialog Minecraft:zh:命令/dialog