/dialogue

From Minecraft Wiki
Jump to navigation Jump to search
Not to be confused with /dialog.
This feature is exclusive to Bedrock Edition and Minecraft Education.
 
/dialogue
Permission level
required
1
Restrictions Cheat only

Opens an NPC dialogue screen to the player(s), or changes the dialogue displayed by an NPC.

Usage

[edit | edit source]

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

[edit | edit source]
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.
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.

Arguments

[edit | edit source]

npc: target: CommandSelector<Actor>

Specifies the target to open an NPC screen from.
Must be a player name or a target selector. And it should target only one entity that has the minecraft:npc component.

player: target: CommandSelector<Player>

Specifies the player(s) to display the NPC screen.
Must be specified in open mode. In change mode, all players are affected if not specified.
Must be a player name or a target selector.

sceneName: string: basic_string

Specifies what scene to show from the dialogue folder in a behavior pack from the scene_tag property.
Must be specified in change mode. In open mode, the last dialogue shown is used if not specified.
Must be a string. And it must be a single word that has no space or a double-quoted string (When quoted, \ can be used to escape characters).

Result

[edit | edit source]

CommandTriggerBedrock Edition
AnyThe command is incomplete, or any argument is not specified correctly. Unparseable
npc: target fails to resolve to a singular entity with the minecraft:npc component. Failed
player: target is a target selector that is not in player type.
player: target fails to resolve one or more online players.
sceneName: string fails to resolve to a dialogue tag in a behavior pack.
OtherwiseSuccessful

Output

[edit | edit source]

CommandEditionSituationSuccess Count
AnyBedrock EditionOn fail0
On success1

Examples

[edit | edit source]
  • 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

[edit | edit source]

Bedrock Edition

[edit | edit source]
Bedrock Edition
1.17.10beta 1.17.10.22Added /dialogue.

Minecraft Education

[edit | edit source]
Minecraft Education
1.17.301.17.30.2Added /dialogue.
[edit | edit source]
[edit | edit source]