Minecraft:Commands/dialogue: Difference between revisions
More actions
Remove broken links to missing pages |
Fix template calls: add MC/ prefix |
||
| Line 1: | Line 1: | ||
{{Distinguish|/dialog}} | {{MC/Distinguish|/dialog}} | ||
{{Exclusive|bedrock|edu}} | {{MC/Exclusive|bedrock|edu}} | ||
{{Infobox command | {{Infobox command | ||
|name=dialogue | |name=dialogue | ||
| Line 24: | Line 24: | ||
== Arguments == | == Arguments == | ||
{{ | {{MC/Argument|be=1|npc: target|CommandSelector<Actor>}} | ||
: Specifies the target to open an NPC screen from. | : Specifies the target to open an NPC screen from. | ||
: {{ | : {{MC/Arg desc|be=CommandSelector<Actor>}} And it should target only one entity that has the <code>minecraft:npc</code> component. | ||
{{ | {{MC/Argument|be=1|player: target|CommandSelector<Player>}} | ||
: Specifies the player(s) to display the NPC screen. | : Specifies the player(s) to display the NPC screen. | ||
: Must be specified in <code>open</code> mode. In <code>change</code> mode, all players are affected if not specified. | : Must be specified in <code>open</code> mode. In <code>change</code> mode, all players are affected if not specified. | ||
: {{ | : {{MC/Arg desc|be=CommandSelector<Player>}} | ||
{{ | {{MC/Argument|be=1|sceneName: string|basic_string}} | ||
: Specifies what scene to show from the dialogue folder in a behavior pack from the <code>scene_tag</code> property. | : Specifies what scene to show from the dialogue folder in a behavior pack from the <code>scene_tag</code> property. | ||
: Must be specified in <code>change</code> mode. In <code>open</code> mode, the last dialogue shown is used if not specified. | : Must be specified in <code>change</code> mode. In <code>open</code> mode, the last dialogue shown is used if not specified. | ||
: {{ | : {{MC/Arg desc|be=string}} | ||
== Result == | == Result == | ||
| Line 49: | Line 49: | ||
== Output == | == Output == | ||
{{Output table|onlybe=1}} | {{MC/Output table|onlybe=1}} | ||
{{Output table|edition=be|On fail|0}} | {{MC/Output table|edition=be|On fail|0}} | ||
{{Output table|On success|1}} | {{MC/Output table|On success|1}} | ||
{{Output table}} | {{MC/Output table}} | ||
== Examples == | == Examples == | ||
| Line 63: | Line 63: | ||
=== ''Bedrock Edition'' === | === ''Bedrock Edition'' === | ||
{{HistoryTable | {{HistoryTable | ||
|{{HistoryLine|bedrock}} | |{{MC/HistoryLine|bedrock}} | ||
|{{HistoryLine||1.17.10|dev=beta 1.17.10.22|Added {{ | |{{HistoryLine||1.17.10|dev=beta 1.17.10.22|Added {{MC/Cmd|dialogue|link=none}}.}} | ||
}} | }} | ||
=== ''Minecraft Education'' === | === ''Minecraft Education'' === | ||
{{HistoryTable | {{HistoryTable | ||
|{{HistoryLine|education edition}} | |{{MC/HistoryLine|education edition}} | ||
|{{HistoryLine||1.17.30|dev=1.17.30.2|Added {{ | |{{HistoryLine||1.17.30|dev=1.17.30.2|Added {{MC/Cmd|dialogue|link=none}}.}} | ||
}} | }} | ||
| Line 78: | Line 78: | ||
== Navigation == | == Navigation == | ||
{{Navbox commands}} | {{MC/Navbox commands}} | ||
ja:コマンド/dialogue | ja:コマンド/dialogue | ||
Latest revision as of 20:09, 9 April 2026
Template:Hatnote Script error: No such module "Exclusive". Template:Infobox command Opens an NPC dialogue screen to the player(s), or changes the dialogue displayed by an Minecraft:NPC.
Usage
Dialogue can be branched with the use of a scene file. The scene file is a Json file located inside the dialogue folder in the root directory of the active behavior pack that contains all the information needed for branching dialogue. There is no limit to the amount of scene files, as the game reads all the files in the folder and call based on scene_tag property indicated in the given scene data.
See this documentation for scene file setup.
Syntax
dialogue open <npc: target> <player: target> [sceneName: string]- Forces open the targeted NPC's dialogue box to the targeted player(s), simulating the experience of clicking on an NPC.
- A targeted scene can also be indicated.
- Forces open the targeted NPC's dialogue box to the targeted player(s), simulating the experience of clicking on an NPC.
dialogue change <npc: target> <sceneName: string> [player: target]- Changes the content of the targeted NPC according to the targeted scene, including dialogue, commands, and name.
- This closes the dialogue box and update for the next time the NPC is interacted.
- The content can be updated on a per-player basis. If no player is targeted, the dialogue updates for all players.
- Changes the content of the targeted NPC according to the targeted scene, including dialogue, commands, and name.
Arguments
npc: target: CommandSelector<Actor>
- Specifies the target to open an NPC screen from.
- {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|inapplicability}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}} And it should target only one entity that has the
minecraft:npccomponent.
player: target: CommandSelector<Player>
- Specifies the player(s) to display the NPC screen.
- Must be specified in
openmode. Inchangemode, all players are affected if not specified. - {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|inapplicability}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
sceneName: string: basic_string
- Specifies what scene to show from the dialogue folder in a behavior pack from the
scene_tagproperty. - Must be specified in
changemode. Inopenmode, the last dialogue shown is used if not specified. - {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|string}}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 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}}|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}}|1}}{{#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
- Open the dialogue of an NPC with tag "ducky" toward the nearest player showing scene "ducky_intro":
dialogue open @e[type=npc, tag=ducky] @p ducky_intro
- Change the dialogue of an NPC with tag "ducky" into scene "duck_intro" toward the initiator:
dialogue change @e[type=npc, tag=ducky] ducky_intro @initiator
History
Bedrock Edition
Minecraft Education
External links
ja:コマンド/dialogue lzh:令/dialogue pt:Comandos/dialogue zh:命令/dialogue de:Befehl/dialogue