Dialog
Dialogs are simple modal windows that can display information and receive player input.
Usage
Dialogs can be displayed to players using the /dialog command by server operators while in gameplay. Additionally, they can be displayed through a show_dialog action in a text component or another dialog (see § Action format). They can also be configured for the pause menu and when pressing the quick actions hotkey (see § Dialog tag).
Dialogs enable various forms of interaction with the game, including:
- Sending messages or information using text components, including rich text formatting and clickable links (excluding type nbt, score and selector[1]);
- Receiving player input through input control fields such as textbox, toggle, slider, and option selection;
- Executing commands via action buttons (privileged commands can only be executed by server operators); and
- Navigating between multiple dialogs using nested structures.
Dialogs mostly comprise of these three elements, however their exact contents are dependent of the type:
- Header, which contains the title and warning button;
- Body elements, which may be labels, inputs, buttons, and submit actions (scrollable if needed); and
- Optional footer, which may contain confirmation buttons and submit actions.
When a dialog window opens, player controls are disabled temporarily until the user exits the window through an exit action button, the escape key (Esc), or the warning button next to the dialog's title (which returns the user back to the title screen). In singleplayer, a dialog can be configured to pause the game, in which case the game also autosaves.
Definition
Dialog can be defined in data packs, as part of the directory structure below.
data pack name.zip or
data pack name
pack.mcmeta
data
namespace
dialog
<name>.json
- More directories…
Dialog format
Dialogs have different structure depending on their type, which is specified by [String] type tag. The structure below applies to every dialog types:
- *: If parent field is written, this field is required.
- [NBT Compound / JSON Object] The root tag.
- [String] type*: One of dialog types from the
minecraft:dialog_typeregistry:minecraft:noticeminecraft:confirmationminecraft:multi_actionminecraft:server_linksminecraft:dialog_list
- [String][NBT List / JSON Array][NBT Compound / JSON Object] title*: Screen title, text component. Should be always visible on screen, no matter the specific type.
- [String][NBT List / JSON Array][NBT Compound / JSON Object] external_title: Name to be used for a button leading to this dialog (for example, on the pause menu), optional text component. If not present, title will be used instead.
- [NBT List / JSON Array][NBT Compound / JSON Object] body: Optional list of body elements or a single body element. See Dialog § Body format.
- [NBT List / JSON Array] inputs: Optional list of input controls. See Dialog § Input control format.
- [Boolean] can_close_with_escape: Can dialog be dismissed with Escape key. Defaults to
true. - [Boolean] pause: If the dialog screen should pause the game in single-player mode. Defaults to
true. - [String] after_action: An additional operation performed on the dialog after click or submit actions. Defaults to
close. Can be one of the following:close: Closes the dialog and returns to the previous non-dialog screen (if any).none: Does nothing, i.e. keeps the current dialog screen open (only available if [Boolean] pause isfalseto avoid locking the game in single-player mode).wait_for_response: Replace the current dialog with a "Waiting for Response" screen.
- Other fields depending on [String] type, see below.
- [String] type*: One of dialog types from the
notice

minecraft:notice dialog type.A dialog screen with a single action button in footer, specified by [NBT Compound / JSON Object] action. By default, the exit action (which returns the player back to gameplay) is the same [NBT Compound / JSON Object] action button.
- [NBT Compound / JSON Object] The root tag.
- [String] type*:
minecraft:notice. - Tags common to all dialog types see Template:Nbt inherit/dialog/template
- [NBT Compound / JSON Object] action: Click action. Defaults to button with
gui.oklabel and no action or tooltip.- [String][NBT List / JSON Array][NBT Compound / JSON Object] label*: Text component.
- [String][NBT List / JSON Array][NBT Compound / JSON Object] tooltip: Optional text component to display when button is highlighted or hovered over.
- [Int] width: Value between 1 and 1024 — Width of the button. Defaults to 150.
- [NBT Compound / JSON Object] action: An action to perform when button is clicked. See Dialog § Action format
- [String] type*:
confirmation

minecraft:confirmation dialog type.A dialog screen with two action buttons in footer, specified by [NBT Compound / JSON Object] yes and [NBT Compound / JSON Object] no. By default, the exit action is [NBT Compound / JSON Object] no button.
- [NBT Compound / JSON Object] The root tag.
- [String] type*:
minecraft:confirmation. - Tags common to all dialog types see Template:Nbt inherit/dialog/template
- [NBT Compound / JSON Object] yes*: Click action for positive outcome.
- [String][NBT List / JSON Array][NBT Compound / JSON Object] label*: Text component.
- [String][NBT List / JSON Array][NBT Compound / JSON Object] tooltip: Optional text component to display when button is highlighted or hovered over.
- [Int] width: Value between 1 and 1024 — Width of the button. Defaults to 150.
- [NBT Compound / JSON Object] action: An action to perform when button is clicked. See Dialog § Action format
- [NBT Compound / JSON Object] no*: Click action for negative outcome.
- [String][NBT List / JSON Array][NBT Compound / JSON Object] label*: Text component.
- [String][NBT List / JSON Array][NBT Compound / JSON Object] tooltip: Optional text component to display when button is highlighted or hovered over.
- [Int] width: Value between 1 and 1024 — Width of the button. Defaults to 150.
- [NBT Compound / JSON Object] action: An action to perform when button is clicked. See Dialog § Action format
- [String] type*:
multi_action

minecraft:multi_action dialog type.A dialog screen with a scrollable list of action buttons arranged in columns. If [NBT Compound / JSON Object] exit_action is present, a button for it will appear in the footer, otherwise the footer is not present. [NBT Compound / JSON Object] exit_action is also used for the Escape action.
- [NBT Compound / JSON Object] The root tag.
- [String] type*:
minecraft:multi_action. - Tags common to all dialog types see Template:Nbt inherit/dialog/template
- [NBT List / JSON Array] actions*: Non-empty list of click actions.
- [String][NBT List / JSON Array][NBT Compound / JSON Object] label*: Text component.
- [String][NBT List / JSON Array][NBT Compound / JSON Object] tooltip: Optional text component to display when button is highlighted or hovered over.
- [Int] width: Value between 1 and 1024 — Width of the button. Defaults to 150.
- [NBT Compound / JSON Object] action: An action to perform when button is clicked. See Dialog § Action format
- [Int] columns: Positive integer describing number of columns. Defaults to 2.
- [NBT Compound / JSON Object] exit_action: Action for leaving the dialog.
- [String][NBT List / JSON Array][NBT Compound / JSON Object] label*: Text component.
- [String][NBT List / JSON Array][NBT Compound / JSON Object] tooltip: Optional text component to display when button is highlighted or hovered over.
- [Int] width: Value between 1 and 1024 — Width of the button. Defaults to 150.
- [NBT Compound / JSON Object] action: An action to perform when button is clicked. See Dialog § Action format
- [String] type*:
server_links

minecraft:server_links dialog type.A dialog screen with scrollable list of server links, arranged in columns. If [NBT Compound / JSON Object] exit_action is present, a button for it will appear in the footer, otherwise the footer is not present. [NBT Compound / JSON Object] exit_action is also used for the Escape action.
- [NBT Compound / JSON Object] The root tag.
- [String] type*:
minecraft:server_links. - Tags common to all dialog types see Template:Nbt inherit/dialog/template
- [NBT Compound / JSON Object] exit_action: Action for leaving the dialog.
- [String][NBT List / JSON Array][NBT Compound / JSON Object] label*: Text component.
- [String][NBT List / JSON Array][NBT Compound / JSON Object] tooltip: Optional text component to display when button is highlighted or hovered over.
- [Int] width: Value between 1 and 1024 — Width of the button. Defaults to 150.
- [NBT Compound / JSON Object] action: An action to perform when button is clicked. See Dialog § Action format
- [Int] columns: Positive integer describing number of columns. Defaults to 2.
- [Int] button_width: Value between 1 and 1024 — Width of the button. Defaults to 150.
- [String] type*:
dialog_list

minecraft:dialog_list type dialog with all dialog types.A dialog screen with scrollable list of buttons leading directly to other dialogs, arranged in columns. Titles of those buttons will be taken from [String] external_title fields of targeted dialogs. If [NBT Compound / JSON Object] exit_action is present, a button for it will appear in the footer, otherwise the footer is not present. [NBT Compound / JSON Object] exit_action is also used for the Escape action.
- [NBT Compound / JSON Object] The root tag.
- [String] type*:
minecraft:dialog_list. - Tags common to all dialog types see Template:Nbt inherit/dialog/template
- [String][NBT Compound / JSON Object][NBT List / JSON Array] dialogs*: Any number of (s) (an [String] ID, or a new [NBT Compound / JSON Object] dialog definition, or a [String] tag with
#, or an [NBT List / JSON Array] array containing either [String] IDs or new [NBT Compound / JSON Object] definitions in the same data type) to show in the list. - [NBT Compound / JSON Object] exit_action: Action for leaving the dialog.
- [String][NBT List / JSON Array][NBT Compound / JSON Object] label*: Text component.
- [String][NBT List / JSON Array][NBT Compound / JSON Object] tooltip: Optional text component to display when button is highlighted or hovered over.
- [Int] width: Value between 1 and 1024 — Width of the button. Defaults to 150.
- [NBT Compound / JSON Object] action: An action to perform when button is clicked. See Dialog § Action format
- [Int] columns: Positive integer describing number of columns. Defaults to 2.
- [Int] button_width: Value between 1 and 1024 — Width of the button. Defaults to 150.
- [String] type*:
Body format
All dialogs have a list of body elements describing contents between title and actions or inputs.
plain_message
A multiline label.
- [NBT Compound / JSON Object]: The body element
- [String] type*:
minecraft:plain_message - [String][NBT List / JSON Array][NBT Compound / JSON Object] contents*: Text component. Does not support nbt, score and selector components.[1]
- [Int] width: Value between 1 and 1024 — Maximum width of message. Defaults to 200.
- [String] type*:
item
An item with optional description. It appears like it is in the inventory slot when the mouse hovers over the item. The size does not scale even if width and height are set to other values than the default. If the description is present, then it appears next to the right side of the item.
- [NBT Compound / JSON Object]: The body element
- [String] type*:
minecraft:item - [NBT Compound / JSON Object] item*: Item stack with count.
- [String] id*: Item identifier.
- [Int] count: Item count.
- [NBT Compound / JSON Object] components: Optional. Additional information about the item. See item components.
- [String][NBT List / JSON Array][NBT Compound / JSON Object] description: A compound or a text component (does not support nbt, score and selector components.[1])
- [String][NBT List / JSON Array][NBT Compound / JSON Object] contents: Text component (does not support nbt, score and selector components.[1])
- [Int] width: Value between 1 and 1024 — Maximum width of message. Defaults to 200.
- [Boolean] show_decoration: If true, count and damage bar will be rendered over the item. Defaults to
true. - [Boolean] show_tooltip: If true, item tooltip will show up when item is hovered. Defaults to
true. - [Int] width: Value between 1 and 256 — Horizontal size of element. Defaults to 16.
- [Int] height: Value between 1 and 256 — Vertical size of element. Defaults to 16.
- [String] type*:
Input control format

Input controls are used to receive certain information from the players. These information can be used with the associated [String] key tag, for example, when an action button is clicked, the [String] key can be used to reference information stored on that input control, either when running a command with macro substitution, or a custom NBT tag sent to the server (see § Dynamic action types).
All input control types have a label field.
- [NBT Compound / JSON Object]: The input control
- [String] type*: One of dialog types from the
minecraft:input_control_typeregistry:minecraft:textminecraft:booleanminecraft:single_optionminecraft:number_range
- [String] key*: String identifier of value used when submitting data, must be a valid template argument (letters, digits and
_). - [String][NBT List / JSON Array][NBT Compound / JSON Object] label*: A text component to be displayed to the left of the input.
- Additional fields based on [String] type, see below.
- [String] type*: One of dialog types from the
text
A basic, single line, text input.
Output values:
- As template substitution: contents with special characters escaped using escape sequences to fit into an SNBT string.
- As tag: a string tag with contents without modification.
- [NBT Compound / JSON Object]: The input control
- [String] type*:
minecraft:text - Tags common to all dialog input control types see Template:Nbt inherit/dialog/input control/template
- [Int] width: Value between 1 and 1024 — The width of the input. Defaults to 200.
- [Boolean] label_visible: Controls if the label is visible. Defaults to
true. - [String] initial: The initial value of the text input.
- [Int] max_length: Maximum length of input. Defaults to 32.
- [NBT Compound / JSON Object] multiline: If present, allows users to input multiple lines, optional object with fields:
- [Int] max_lines: Optional positive integer. If present, limits maximum lines.
- [Int] height: Value between 1 and 512 — Height of input.
- [String] type*:
boolean
A checkbox.
Output values:
- As template substitution: [String] on_true when checked, [String] on_false when unchecked.
- As tag:
1bwhen checked,0bwhen unchecked.
- [NBT Compound / JSON Object]: The input control
- [String] type*:
minecraft:boolean - Tags common to all dialog input control types see Template:Nbt inherit/dialog/input control/template
- [Boolean] initial: The initial value of the checkbox. Defaults to
false(unchecked). - [String] on_true: The string value to send when true. Defaults to 'true'.
- [String] on_false: The string value to send when false. Defaults to 'false'.
- [String] type*:
single_option
A preset option selection.
- [NBT Compound / JSON Object]: The input control
- [String] type*:
minecraft:single_option - Tags common to all dialog input control types see Template:Nbt inherit/dialog/input control/template
- [Boolean] label_visible: Controls if the label is visible. Defaults to
true. - [Int] width: Value between 1 and 1024 — The width of the input. Defaults to 200.
- [NBT List / JSON Array] options*: A non-empty list of options to be selected from:
- [NBT Compound / JSON Object] option: An option compound.
- [String] id*: The value to be sent on submit.
- [String][NBT List / JSON Array][NBT Compound / JSON Object] display: A text component for what the option is displayed as.
- [Boolean] initial: Only one option can have this set to
true. Iftrue, the option chosen will be the initial one. Defaults to the first option beingtrue, and all othersfalse.
- [NBT Compound / JSON Object] option: An option compound.
- [String] type*:
number_range
A number slider.
Output values:
- As template substitution: text representation of current value.
- Whole numbers will be sent without decimal point.
- As tag: a float tag with current value.
- [NBT Compound / JSON Object]: The input control
- [String] type*:
minecraft:number_range - Tags common to all dialog input control types see Template:Nbt inherit/dialog/input control/template
- [String] label_format: A translation key to be used for building label (first argument is contents of label field, second argument is current value). Defaults to
options.generic_value. - [Int] width: Value between 1 and 1024 — The width of the input. Defaults to 200.
- [Float] start*: The minimum number of the slider.
- [Float] end*: The maximum number of the slider.
- [Float] step: Step size (If present, only values of will be allowed. If absent, any value from the range is allowed).
- [Int] initial: The initial increment value of the slider. Defaults to the middle of the range.
- [String] type*:
Action format
Static action types
Static actions are actions that don't depend on the value of an input field. They are identical to text component events (except for open_file). They use the same format but with the action tag replaced with type.
For example, when using show_dialog, entry for action button will look like:
{
"label": "Show dialog label",
"action": {
"type": "show_dialog",
"dialog": "custom:my_dialog"
}
}
open_url
Opens the specified URL in the user's default web browser.
- [NBT Compound / JSON Object] action
- [String] type:
open_url - [String] url: The URL to open.
- [String] type:
run_command
Runs the specified command. This runs as if the player typed the specified command in chat and pressed enter. However, this can only be used to run commands that do not send chat messages directly (like /say, /tell, and /teammsg). Since they are being run from chat, the player must have the required permissions.
- [NBT Compound / JSON Object] action
- [String] type:
run_command - [String] command: The command to run. Does not need to be prefixed with a
/slash.
- [String] type:
suggest_command
Opens chat and fills in the specified text or command. If a chat message was already being composed, it is overwritten.
- [NBT Compound / JSON Object] action
- [String] type:
suggest_command - [String] command: The command to fill in chat. Also works with normal texts.
- [String] type:
change_page
Can only be used in written books. Changes to the specified page if that page exists.
- [NBT Compound / JSON Object] action
- [String] type:
change_page - [Int] page: The page to change to.
- [String] type:
copy_to_clipboard
Copies the specified text to the clipboard.
- [NBT Compound / JSON Object] action
- [String] type:
copy_to_clipboard - [String] value: The text to copy.
- [String] type:
show_dialog
Opens the specified .
- [NBT Compound / JSON Object] action
- [String] type:
show_dialog - [String][NBT Compound / JSON Object] dialog: One (an [String] ID, or a new [NBT Compound / JSON Object] dialog definition) to display.
- [String] type:
custom
Sends a custom event to the server; has no effect on vanilla servers.
- [NBT Compound / JSON Object] action
- [String] type:
custom - [String] id: Any ID to identify the event.
- [String] payload: Optional payload of the event.
- [String] type:
Dynamic action types
Can be used in conjunction with input controls.
dynamic/run_command
This action will build a run_command event using a provided macro template
- [NBT Compound / JSON Object] action
- [String] type:
dynamic/run_command - [String] template: A string with a macro template to be interpreted as a command.
- [String] type:
dynamic/custom
This method will build a minecraft:custom event using all input values.
All input contents will be sent together inside a [NBT Compound / JSON Object] compound tag, with tag value of each input put under id from key field of that input.
Additional static fields can be added to payload.
- [NBT Compound / JSON Object] action
- [String] type:
dynamic/custom - [NBT Compound / JSON Object] additions: Fields to be added to payload.
- [String] id: Namespaced ID.
- [String] type:
Dialog tag
A data pack can apply one or more dialogs to the pause screen and the quick actions hotkey using the #minecraft:pause_screen_additions and #minecraft:quick_actions tags. If multiple dialogs are applied to the same method, the built-in minecraft:custom_options or minecraft:quick_actions dialog is shown instead which by default feature a list of all dialogs in the respective tags, using the [String] external_title tag in the dialogs.
History
| Java Edition | |||||||
|---|---|---|---|---|---|---|---|
| 1.21.6 | 25w20a | Dialogs were introduced. | |||||
| 25w21a | run_command click actions now correctly close dialogs even if the command does not require elevated permissions. | ||||||
| Dialogs should now correctly return to the previous non-dialog screen on close in all cases. | |||||||
| If a new dialog is received by the client while warning screen is visible, it will not replace it, but when user clicks the "Back" button, the new dialog will be restored instead. | |||||||
| The sizes of elements in dialogs are now restricted. | |||||||
| Pre-Release 1 | Dialogs can now configure if they pause the game and if they close after an action is taken. | ||||||
| Every dialog can now have inputs and can submit information. | |||||||
The minecraft:custom click event has been expanded to carry full a NBT tag. | |||||||
| A new keybind called "Quick Actions" has been added to allow accessing content-configured dialogs. | |||||||
simple_input_form and multi_action_input_form were removed | |||||||
| Pre-Release 2 | The minecraft:text input control now escapes special characters in the input when used in template substitution. | ||||||
References
| |||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||
| ||||||||||||||||