Dialogs
Minecraft includes a powerful dialog system that allows creating interactive modal windows for displaying information and receiving player input. Dialogs are native Minecraft features introduced in Java Edition 1.21.6 that enable sophisticated user interfaces within the game. With **Kore **, you can easily create and manage these dialogs using a comprehensive Kotlin DSL that maps directly to Minecraft's dialog format.
Minecraft's dialog system supports various interaction types including:
- Displaying rich text with formatting and clickable elements
- Receiving player input through text fields, toggles, sliders, and option selections
- Executing commands via action buttons (with appropriate permissions)
- Navigating between multiple dialogs using nested structures
- Integration with the pause menu and quick actions hotkey
For the vanilla reference, see the Minecraft Wiki – Dialog and Commands/dialog.
Minecraft Dialog System Overview
Minecraft dialogs consist of three main elements:
- Header: Contains the title and warning button
- Body elements: Labels, inputs, buttons, and submit actions (scrollable if needed)
- Optional footer: Confirmation buttons and submit actions
When a dialog opens, player controls are temporarily disabled until the user exits through an action button, the Escape key, or the warning button. In single-player mode, dialogs can be configured to pause the game and trigger an autosave.
Set Up Your Data Pack Function
Begin by creating a function within your DataPack
where you'll define your dialogs:
Initialize the Dialogs Block
Use the dialogBuilder
to start defining your dialogs:
Or use the dialogs
DSL:
Dialog Types
Minecraft currently supports five different dialog types:
Confirmation Dialog
A dialog with two action buttons (yes/no) for binary choices:
Notice Dialog
A simple dialog with a single action button for displaying information:
Multi Action Dialog
A dialog with multiple action buttons arranged in columns, perfect for menus:
Dialog List
A dialog that displays a scrollable list of other dialogs:
Server Links Dialog
A specialized dialog for displaying server links (configured server-side):
Dialog Properties
All dialogs share common properties that can be customized:
Basic Properties
After Actions
Control what happens after dialog interactions:
AfterAction.NONE
- Do nothingAfterAction.CLOSE
- Close the dialog (default)AfterAction.WAIT_FOR_RESPONSE
- Keep dialog open awaiting response
Body Elements
Dialogs can contain rich content between the title and action buttons:
Plain Messages
Display text content:
Items
Display items with descriptions:
Input Controls
Multi-action dialogs can include various input controls for user interaction:
Text Input
Single-line or multi-line text input:
Number Range
Slider controls for numeric input:
Boolean Toggle
Checkbox-style boolean input:
Single Option
Dropdown-style selection:
Actions
Dialog actions define what happens when buttons are clicked:
Available Action Types
Action Properties
Enhance actions with labels, tooltips, and sizing:
Using Dialogs in Commands
Commands can show and clear dialogs to players, using a reference or an inline dialog:
Advanced Examples
Complex Form Dialog
Interactive Tutorial System
Best Practices
- Keep dialogs focused: Each dialog should serve a single, clear purpose
- Use appropriate dialog types:
- Confirmation for yes/no decisions
- Notice for information display
- Multi-action for complex forms or menus
- Provide clear labels: Make button and input labels descriptive
- Include tooltips: Add helpful tooltips for complex actions
- Handle edge cases: Provide cancel/exit options where appropriate
Integration with Other Systems
Dialogs work seamlessly with other Kore features: