Commands/dialogue

Used to open the NPC dialogue to the player and change the dialogue displayed by an NPC.
== Syntax ==
;dialogue open
: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.
:Syntax:
::dialogue open <npc: target> <player: target> [sceneName: string]
:Example: 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
;dialogue change
:Changes the content of the targeted NPC according to the targeted scene, including dialogue, commands, and name.
::* This will close 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 will update for all players.
:Syntax:
::dialogue change <npc: target> <sceneName: string> [player: target]
:Example: 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
== Arguments ==
<npc: target>: CommandSelector<Actor>
: Specifies the target to open a NPC menu from.
:* Must be a target selector for an entity type that has the minecraft:npc component.
<player: target>: CommandSelector<Player>
: Specifies the target(s) to display the NPC menu.
:* Must be a player name or target selector of player type.
:* Must be specified in open mode. In change mode, all players are affected if not specified.
[sceneName: string]: string
: Specifies what scene to show from the dialogue folder in a behavior pack from the scene_tag property.
:* Must be either a single word (no spaces) or a quoted string.
:* Must be specified in change mode. In open mode, the last dialogue shown will be used if not specified.
== Description ==
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 will read 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.
== Result ==
== Output ==
== History ==
ja:コマンド/dialogue
pt:Comandos/dialogue
zh:命令/dialogue