Skip to main content

Dialog Menu

Native Minecraft dialog screens driven by TypeWriter: buttons, inputs, confirmations.

Freev0.7Menus & visuals
RequiresTypeWriter0.9Paper1.21.6+Basic extensionPlaceholderAPIoptional

Overview​

Dialog Menu opens the native dialog screens of Minecraft 1.21.6 and later, through Paper's dialog API. A dialog is a window in the middle of the screen with a title, a text body, an optional item, buttons and input fields. It needs no resource pack and no custom inventory.

You build the whole dialog in one action entry, Paper Dialog. Each button either runs a command as the player or triggers other TypeWriter entries. Input fields (text, toggle, choice, slider) are read when the player confirms, and their values are inserted into the command with $(key).

Features​

  • Native dialogs — the vanilla dialog window, opened with Paper's dialog API.
  • Three layouts — a grid of buttons, a yes/no confirmation, or a single-button notice.
  • Action buttons — run a command as the player, optionally as OP.
  • Trigger buttons — fire TypeWriter entries directly, with no command.
  • Inputs — text field (including multi-line), toggle, multiple choice and number slider.
  • Input values in commands — use $(key) in a command to insert what the player typed or chose.
  • Dynamic text — titles, messages and labels accept MiniMessage and PlaceholderAPI placeholders.
  • Body item — show an item in the dialog body.
  • After-action behaviour — close the dialog, keep it open, or wait for a server response.
  • Placeholder — check whether a player currently has a dialog open.

Installation​

  1. Run Paper (or a fork such as Folia) 1.21.6 or later: older versions do not have the dialog API.
  2. Make sure the Basic extension of TypeWriter is installed (see the TypeWriter documentation).
  3. Optional: install PlaceholderAPI to use placeholders in texts.
  4. Put the Dialog Menu JAR in plugins/Typewriter/extensions/ and restart the server.

Getting started​

Show a confirmation window before teleporting a player:

  1. In the TypeWriter web panel, open a sequence page and add a Paper Dialog entry.
  2. Set displayName to <gold>Travel to the spawn? and message to the text of the dialog body.
  3. Set dialogType to CONFIRMATION.
  4. In buttons, add an action button. Set its label to Yes and its command to spawn.
  5. In exitButton, set label to No. Leave command empty: the button then only closes the dialog.
  6. Link the entry to what should open it: an NPC interaction, a command, or a dialogue option.
  7. Publish and trigger the entry in game.

To collect a value, add a text input to buttons: set key to name, buttonLabel to Send, and command to rename $(name). When the player clicks the button, the text is inserted in place of $(name).

warning

asOp runs the command with temporary operator rights. Use it only for commands you fully control, and never insert free text from a player into such a command.

How it works​

When the action runs, the dialog is built from the entry and shown to the triggering player. A button is single-use: after a click, its action runs once for that dialog. The dialog is closed or kept open according to afterAction.

All text fields support MiniMessage and placeholders. displayName falls back to the entry name when empty.

The dialog layout depends on dialogType:

TypeLayout
MULTI_ACTIONA grid of buttons with columns columns, plus the exit button when showExitButton is on.
CONFIRMATIONThe vanilla yes/no window: the first button confirms, the exit button declines. The exit button is always built in this mode.
NOTICEA single-button window using the first button, or the exit button if there is none.

The button types you can add to buttons:

TypeFieldsCommand macro
Action buttonlabel, command, asOpnone
Trigger buttonlabel, triggersnone
Text inputlabel, key (default input), buttonLabel, command, asOp, width, labelVisible, initial, maxLength, maxLines, height$(input)
Boolean togglelabel, key (default boolean), initial, onTrue, onFalse, buttonLabel, command, asOp$(boolean), replaced by onTrue or onFalse
Multiple choicelabel, key (default choice), options, buttonLabel, command, asOp$(choice)
Number rangelabel, key (default value), start, end, initial, step, buttonLabel, command, asOp$(value), rounded to a whole number

Input fields are shown above the buttons. Every input button also adds its own confirmation button, with buttonLabel as text; a command can use the $(key) of any input in the same dialog. The exit button is configured separately in exitButton.

For a multiple choice, write options as a comma-separated list, and add * after the option that should be selected at first, for example Easy,Normal*,Hard.

Placeholders​

PlaceholderAPI placeholders, served by the typewriter expansion.

PlaceholderReturns
%typewriter_inmenudialog%1 if the player has a dialog from this extension open, otherwise 0.
%typewriter_inmenudialog_<name>%1 if the open dialog is the Paper Dialog entry with this entry name. %typewriter_inmenudialog:<name>% also works.

The state is cleared when a button is clicked, when the player quits and when TypeWriter reloads. It is not cleared when the player closes the dialog with the Escape key.

Entries​

1 entries, generated from the extension source.

Actions1

Troubleshooting​

Nothing is shown when the action runs. Dialogs need Paper 1.21.6 or later. On an older server the dialog API does not exist and the action fails. Also check that the entry's criteria pass.

A button does nothing. Command buttons with an empty command only close the dialog. Otherwise the command is run as the player: if the player lacks the permission for it, it fails silently for them, and a failure is logged as Dialog command '…' failed. Test the command in chat first.

$(key) appears in the command or is replaced by nothing. The key of the input and the macro must match exactly. A macro that matches no input is replaced by an empty text. For toggles, the macro gives the onTrue or onFalse value, not true or false.

The buttons stop working after the first click. Each button is single-use per opened dialog. With afterAction set to NONE or WAIT_FOR_RESPONSE the window can stay on screen, but its buttons no longer react. Re-trigger the action to open a fresh dialog.

%typewriter_inmenudialog% stays at 1. The player closed the dialog with Escape, which does not reset the state. It resets on the next button click, when the player leaves or on reload.

  • Companion — open a dialog when the player clicks their companion.