Dialogs
Added a way to display simple modal dialogs to a user
Dialogs are stored in a minecraft:dialog registry, but can also be defined inline
Dialogs are an experimental feature
To avoid user confusion, dialog screens are marked with a warning sign next to the title
Clicking on this warning leads to a screen that explains to user that this screen is provided by custom content
It also gives the user an option to leave the current world to avoid them being locked in an infinite loop of dialogs
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
Dialogs can be displayed by server in play and configuration connection phases
However, only inline registries are allowed in configuration, since registries are not yet available in that phase
Additionally, run_command click event is not available in configuration phase
Dialogs by default will close after the Escape key is pressed
When this happens, dialog will run action specific to dialog type described as "exit action" below
This behavior is configurable
When the dialog screen is closed, the game goes back to previously displayed non-dialog screen or back to gameplay
That means that new dialogs always replace already opened ones, if any
Dialogs can be configured to be accessible from Pause menu
This replaces and expands the "Server Links" button added in previous versions
New key bind called "Quick Actions" has been added to allow accessing content-configured dialogs
Most dialogs follow a common layout, however exact contents depend on type:
Header with title and warning button
Body elements, scrollable if needed:
messages and items
inputs
actions buttons
Optional footer, contains main buttons and submit actions
Developer's Note: Dialogs are not supposed to fully describe any in-game UI, but just to allow custom content to display simple messages and get input from users. This feature is intentionally limited to match that use case.

An example of a custom Dialog screen.

Dialog Description Format
Dialogs are stored in minecraft:dialog registry that can be provided by a datapack
Fields:

type - one of dialog types from minecraft:dialog_type registry
<type-specific> - see below
Common Dialog Fields
Most dialog types share some fields. To avoid duplication, they are listed in this section
Fields:

title - screen title, text component
Should be always visible on screen, no matter the specific type
external_title - name to be used for a button leading to this dialog (for example from Pause screen), optional text component
If not present, title will be used instead
body - optional list of body elements or a single element, see below
inputs - optional list of inputs, see below
can_close_with_escape - can dialog be dismissed with Escape key, default true
pause - should the dialog screen pause the game in single-player mode, default: true
after_action - additional operation performed on dialog after click or submit actions, default: close
close - closes dialog and returns to previous non-dialog screen (if any)
none - do nothing, i.e., keep the current screen open
only available if pause is false to avoid locking the game in single-player mode
wait_for_response - replace the current dialog with a "Waiting for Response" screen
this option is intended to prevent users from sending multiple actions on laggy connections
servers are expected to eventually replace this screen with a new dialog
to avoid accidental locking, a "Back" button will become active after 5 seconds
clicking this button will continue as if the dialog was closed (i.e., game returns to the previous non-dialog screen, if any)
"Waiting for Response" screen will unpause the game in single-player mode to avoid locking the game
Dialog Types
minecraft:notice
A simple screen with one action in footer
Exit action: same as action
Fields:

Common dialog fields (see above)
action - main action (see below), defaults to a button with gui.ok label and no action or tooltip
minecraft:confirmation
A simple screen with two actions in footer
Exit action: same as no action
Fields:

Common dialog fields (see above)
yes - action (see below) for positive outcome
no - action (see below) for negative outcome
minecraft:multi_action
A scrollable list of actions arranged in columns
Screen can have optional exit action that will appear in footer
Exit action: same as exit_action, if present
Fields:

Common dialog fields (see above)
actions - non-empty list of actions (see below)
exit_action - optional action (see below) in footer
columns - positive integer describing number of columns, default: 2
minecraft:server_links
A scrollable list of links received from server in minecraft:server_links packet, arranged in columns
Note: this is a replacement for the previous Server Links screen, but now with an additional body
Exit action: same as exit_action, if present
Fields:

Common dialog fields (see above)
exit_action - optional action (see below) in footer
columns - positive integer describing number of columns, default: 2
button_width - width of buttons in the list, integer from 1 to 1024 (inclusive) with default 150
minecraft:dialog_list
A scrollable list of buttons leading directly to other dialogs, arranged in columns
Titles of those buttons will be taken from external_title fields of targeted dialogs
Exit action: same as exit_action, if present
Fields:

Common dialog fields (see above)
dialogs - dialog, a list of dialogs or a dialog tag
exit_action - optional action (see below) in footer
columns - positive integer describing number of columns, default: 2
button_width - width of buttons in the list, integer from 1 to 1024 (inclusive) with default 150
Dialog Body Types
All dialogs have a list of body elements describing contents between title and actions or inputs
Hover and click events on text components within bodies function as expected
Click events are handled by dialog screen like any other action - that means it will also run after_action
Fields:

type - one of dialog body types from minecraft:dialog_body_type registry
<type-specific> - see below
minecraft:plain_message
A multiline label
Fields:

contents - text component
width - maximum width of message, integer from 1 to 1024 (inclusive) with default 200
minecraft:item
Item with optional description
If a description is present, it will be rendered to the right of item
The Item will be rendered as if it was in inventory slot
The Item is not scaled even if width and height are set to values other than default
Fields:

item - item stack with count
description - optional object with fields:
contents - text component
width - maximum width of contents, integer from 1 to 1024 with default 200
Can also just be text component
show_decorations - if true, count and damage bar will be rendered over the item, default: true
show_tooltip - if true, item tooltip will show up when item is hovered, default: true
width - horizontal size of element, integer from 1 to 256 (inclusive) with default: 16
height - vertical size of element, integer from 1 to 256 (inclusive) with default: 16
Input Control Types
Dialog can contain a set of controls that accept user input
When submitted, the current value of the input will be used to build response to the server according to action selected by user (see below)
When a value is inserted into a macro, template substitution form is used
When a value is sent as a tag, tag form is used
Fields:

type - one of input control types from minecraft:input_control_type registry
key - string identifier of value used when submitting data, must be a valid template argument (letters, digits and _)
<type-specific> - see below
minecraft:text
A simple text input
Output values:
As template substitution: contents with special characters escaped to fit in a SNBT literal (note: both ' and " are escaped)
As tag: a string tag with contents without modification
Fields:

width - width of the text input, integer from 1 to 1024 (inclusive) with default: 200
label - a text component to be displayed to the left of control
label_visible - controls label visibility, default: true
initial - initial contents, default: "" (empty)
max_length - maximum length of the text input, positive integer with default of 32
multiline - if present, allows users to input multiple lines, optional object with fields:
max_lines - if present, limits maximum lines, optional positive integer
height - height of input, optional integer in range 1 to 512
If this field is omitted, but max_lines is present, the height will be chosen to fit the maximum number of lines (but can't exceed 512)
If this and max_lines are both omitted, it will default to a height that fits 4 lines
minecraft:boolean
A plain checkbox with a label
Output values:
As template substitution: on_true when checked, on_false when unchecked
As tag: 1b when checked, 0b when unchecked
Fields:

label - a text component to be displayed to the right of control
initial - an initial value, default: false (i.e., unchecked)
on_true - a string value to send when control is checked, default: true
on_false - a string value to send when control is unchecked, default: false
minecraft:single_option
A button that cycles between a set of options when clicked
Output values:
As template substitution: contents of id field of currently selected option
As tag: a string tag with contents of id field of currently selected option
Fields:

label - a text component to be displayed on the button
label_visible - if true, label will be incorporated into button text, default: true
width - width of the button, integer from 1 to 1024 (inclusive) with default: 200
options - a list of objects with fields:
id - a string value to send on submit
display - a text component to display on button, optional (if not present, id is used)
initial - an optional boolean flag that selects initial option (only one option can have this be set to true)
Additionally, the list might also contain a plain string - in that case it's equivalent to a single entry with field id set to that string and other fields set to default
minecraft:number_range
A slider for picking a numeric value out of some range
Sends currently selected value
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
Fields:

label - a text component to be used as a slider label
label_format - a translation key to be used for building label (first argument is contents of label field, second argument is current value), default: options.generic_value
width - width of input, integer from 1 to 1024 (inclusive) with default: 200
start - start value (when slider is in leftmost position) (inclusive), float
end - end value (when slider is in rightmost position) (inclusive), float
initial - initial value of the slider, float, defaults to the middle of slider range
step - step size, optional positive float
If present, only values of initial + <any integer> * step will be allowed
If absent, any value from range the is allowed
Actions
Dialogs have at least one action, presented to the user as a button. After every action dialog will always evaluate contents of after_action field (see above).

Fields:

label - a button label, text component
tooltip - an optional text component to display when the button is hovered or focused
width - the width of the button, integer from 1 to 1024 (inclusive) with default 150
action - an action to perform when the button is clicked, optional object with fields:
type - value from minecraft:dialog_action_type registry
<type-specific> - see below, depends on type
Static Dialog Action Types
All existing click_event actions (except for open_file) are included as dialog action types.

Uses same format as click_event on text components (but with action replaced with type) For example, when using show_dialog, the entry for action button will look like this:

{
    "label": "some label",
    "action": {
        "type": "show_dialog",
        "dialog": "some:id"
    }
}
minecraft:dynamic/run_command Action Type
This action will build a run_command event using a provided macro template
The macro will be expanded with string values from inputs
For example, if the macro template is some_command $(some_input), the string value from input with key of some_input parameter will be used for the template expansion
Inputs not used in macro will be ignored, while macro parameters not matching any inputs will be replaced with an empty string
Fields:

template - a string with a macro template to be interpreted as a command
minecraft:dynamic/custom Action Type
This method will build a minecraft:custom event using all input values
All input contents will be sent together inside a 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
Fields:

additions - fields to be added to payload, optional compound tag
id - namespaced ID
Built-in Dialogs
The built-in datapack contains some custom dialogs to provide customization of specific screens used by the client.

minecraft:server_links
Replacement for the previously existing "Server Links" screen
Meant to simplify migration for servers that previously used this feature
minecraft:custom_options
Shows contents of minecraft:pause_screen_additions tag (see below)
Allows the user to select a specific dialog if this tag contains multiple entries
Note: Since this tag is meant for interoperability, any content that replaces this dialog should be careful not to hide other dialog providers
Dialog Command
New command has been added to show dialog to clients
Syntax:

dialog show <targets> <dialog> - show dialog to player(s)
<targets> - player name, UUID or a player selector
<dialog> - a namespaced ID from minecraft:dialog registry or inline dialog value as described above
Returns the number of players in targets argument
dialog clear <targets> - clean dialog for player(s), if they have any visible
<targets> - player name, UUID or a player selector
Returns the number of players in targets argument
Pause Screen Configuration
A data pack can request some of the available dialogs to be accessible from Pause screen
This feature replaces the "Server Links" button and is placed on Pause screen according to the same rules
Buttons leading to dialogs exposed in this way will use label described in external_title field
This feature is configured by minecraft:pause_screen_additions dialog tag:
If this tag is not specified or is empty but the server has sent server_links packet, the tag will be handled as if it contained minecraft:server_links dialog
Note: this matches previous Server Links feature behavior
If this dialog is removed, the tag remains empty
If this tag is still empty, the button will not be visible ("Send Feedback" and "Report Bugs" buttons are visible instead)
If this tag has a single element, the pause screen button will lead directly to that dialog
If this tag has multiple elements, the pause screen button will lead to a minecraft:custom_options dialog which (by default) lets user select one of the tag elements
If this dialog is removed, the button is will not be visible
Quick Actions Key Bind
A new key bind has been added that allows users to access a set of dialogs
Default key: G
This feature is configured by minecraft:quick_actions dialog tag
If this tag is empty, the key bind will do nothing
If this tag has a single element, the key bind will open that dialog
If this tag has multiple elements, the key bind will lead to minecraft:quick_actions dialog which (by default) lets user select one of the tag elements
If this dialog is removed, the key bind will do nothing
This option is intended for use in custom content and by servers, so this tag is empty in the Vanilla pack