DialogManager

public class DialogManager

Provides a fluent builder API for constructing Minecraft dialog JSON definitions as described in the official dialog specification for Java Edition. The builders in this file mirror every field and option documented on the Minecraft Wiki, allowing plugins or mods to assemble complex dialog definitions without manually crafting JSON. Once built, the resulting JsonObject can be serialized and passed to player.performCommand("dialog show @s " + jsonString) to display the dialog. See the Minecraft Wiki for a full description of each field and default value:contentReference[oaicite:0]{index=0}.

Types

Link copied to clipboard
public interface Action
Base interface for click actions.
Link copied to clipboard
public class ActionButton
Represents a clickable button within a dialog.
Link copied to clipboard
public enum AfterAction
Enum representing the after_action options.
Link copied to clipboard
public interface BodyElement
Represents a body element within a dialog.
Link copied to clipboard
A boolean checkbox input control:contentReference[oaicite:42]{index=42}.
Link copied to clipboard
public class ChangePageAction implements DialogManager.Action
Action changing the page in a written book:contentReference[oaicite:65]{index=65}.
Link copied to clipboard
Link copied to clipboard
Action copying a value to the clipboard:contentReference[oaicite:66]{index=66}.
Link copied to clipboard
public class CustomAction implements DialogManager.Action
Action sending a custom event to the server:contentReference[oaicite:68]{index=68}.
Link copied to clipboard
public abstract class DialogBuilder<T extends DialogManager.DialogBuilder<T>>
Base builder for all dialog types.
Link copied to clipboard
Link copied to clipboard
public class DialogReference
Represents a reference to another dialog.
Link copied to clipboard
Dynamic custom action that sends all input values back to the server with optional additional fields:contentReference[oaicite:70]{index=70}.
Link copied to clipboard
Dynamic action that builds a run_command event using a macro template:contentReference[oaicite:69]{index=69}.
Link copied to clipboard
public interface InputControl
Represents an input control in a dialog.
Link copied to clipboard
public class ItemBody implements DialogManager.BodyElement
An item body element.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
A number range slider input control:contentReference[oaicite:49]{index=49}.
Link copied to clipboard
public class OpenUrlAction implements DialogManager.Action
Action opening a URL in the player's web browser:contentReference[oaicite:62]{index=62}.
Link copied to clipboard
A plain message body element.
Link copied to clipboard
public class RunCommandAction implements DialogManager.Action
Action running a command on behalf of the player:contentReference[oaicite:63]{index=63}.
Link copied to clipboard
Link copied to clipboard
public class ShowDialogAction implements DialogManager.Action
Action showing another dialog.
Link copied to clipboard
A single option selector input control:contentReference[oaicite:46]{index=46}.
Link copied to clipboard
Action suggesting a command into the chat box:contentReference[oaicite:64]{index=64}.
Link copied to clipboard
public final class TextComponent
Utility class for building simple text components.
Link copied to clipboard
public class TextInput implements DialogManager.InputControl
A single‑line or multiline text input control:contentReference[oaicite:35]{index=35}.

Functions

Link copied to clipboard
public static void clearOwnedDialog(Player player, Object owner)
Link copied to clipboard
public static void forgetDialogOwner(Player player, Object owner)
Link copied to clipboard
public static void sendDialog(Player player, DialogManager.DialogBuilder builder)
public static void sendDialog(Player player, DialogManager.DialogBuilder builder, Object owner)
Link copied to clipboard
public static JsonObject serializeItemComponents(ItemStack itemStack)