Only this pageAll pages
Powered by GitBook
1 of 81

CommandPrompter

Loading...

Getting Started

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Configuration

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Prompts

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Features

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Developers

Loading...

Prompt Argument

Prompt arguments affect one prompt. A normal inline tag has this shape:

<key:filter:Display text flags>

The key and filter are optional. Flags are whitespace-delimited tokens; text such as cost-int is not interpreted as -int.

Prompt keys

  • Empty key: Chat

  • a:: Anvil UI

  • s::

  • p::

  • d::

  • c:, confirm:, confirmation::

  • i:, item::

Keys configured in screen-mappings (prompt-config.yml) route to their configured screen type. Plugins may register . An unresolved key fails closed and aborts the command; it does not fall back to Chat.

Flag
Meaning

The title duration defaults to 70 ticks. Title flags work with every inline prompt and apply to an entire compound dialog block. The title delay counts against that prompt's Prompt-Timeout.

Use <@id> to load a prompt from presets.json. Preset IDs are case-sensitive and cannot contain spaces. Inline flags appended to a preset reference are ignored; configure title_display, sanitize, and other options in the preset itself. Preset sanitize values are honored ("sanitize": false preserves color codes and symbols in answers).

Prefix a configured opening or closing delimiter with a backslash to keep it literal. With the default delimiters, write \< or \>. CommandPrompter removes that escape when assembling the command.

-ds

Disables session sanitation. Normal sanitation removes legacy color codes plus braces, brackets, angle brackets, parentheses, dollar signs, section signs, and ampersands.

-iv:<alias>

Applies a validator from prompt-config.yml. See .

-int

/nick <Who should be renamed? -str> <a:New name -ds -t:"Choose a name"||50>

Flags

Preset prompts

Escaping delimiters

Example

Sign UI
Player UI
Dialog UI
Confirmation
Item Selector
custom keys

Requires a signed 32-bit Java integer.

-str

Requires a nonblank string.

-timeout:<seconds>

Overrides this prompt's timeout; accepted range is 1–3600.

-breakIf:<condition>

Cancels the flow after this answer when an answer-only condition is true. See .

-t

Shows the prompt's display text as an on-screen title before opening the prompt.

-t:Main

Uses a custom main title.

-t:"Main Title"|Sub|70

Uses a main title, subtitle, and duration in ticks. Quote values that contain spaces.

-t:"Main"||70

Sets the main title and duration while omitting the subtitle.

Input Validation
Command Flows

Welcome

Welcome to the official documentation for CommandPrompter! This documentation is designed to provide comprehensive guidance on configuring and utilizing the CommandPrompter plugin effectively.

About CommandPrompter

CommandPrompter is a powerful tool that enhances the command prompting experience in your Minecraft server. With its customizable configuration options, CommandPrompter allows you to tailor the command prompting process to suit your server's specific requirements.

Need Further Assistance?

If you encounter any issues or require additional assistance that isn't covered in this documentation, please don't hesitate to join our Discord server, where our friendly community is ready to help you out.

You can also chat with our custom developed support agent Skye . Skye knows everything about CommandPrompter, so just join the discord server and talk to Skye in the #skye-chat channel.

If you can't find the information you're looking for in this GitBook, please check the for additional resources and support.

We hope you find this documentation helpful in maximizing the potential of the CommandPrompter plugin for your Minecraft server!

Love using CommandPrompter? Support its growth and future development on Ko-fi, and be a part of shaping the next level of menu creation and command interactivity for your server! You will also get a special supporter role on the Discord server!

Why CommandPrompter?

CommandPrompter turns static commands (like those in DeluxeMenus, ChestCommands, or Citizens NPCs) into interactive workflows.

The Problem

Traditional menu buttons execute fixed, hardcoded commands. You cannot easily prompt a player for dynamic input (such as a target player name, a reason, or an amount) without complex workarounds.

The Solution

By replacing static arguments with prompt placeholders (e.g., /ban <Who do you want to ban?> <Reason?>), CommandPrompter dynamically captures player input at runtime and constructs the final command.

Use Cases

  • NPC Interaction: Ask for confirmation before performing actions like teleportation.

  • Announcements: Let staff broadcast custom messages via a simple menu button.

  • Economy/Shops: Prompt players for quantities when buying or selling items.

  • Moderation: Query staff for player names, ban reasons, or mute durations dynamically.

Further Documentation

Support the Development

Join Our Discord Server
CommandPrompter GitHub repository

Installation

Requirements

  • A Paper-compatible server running Minecraft 26.1.2 or 26.2.x (Paper or a compatible fork such as Purpur).

  • Java 25.

CommandPrompter 3.x is built against Paper APIs and is not a Spigot/Bukkit plugin. It declares Folia support and has no required plugin dependencies. Integrations such as PlaceholderAPI, LuckPerms, Towny, HuskTowns, WorldGuard, CarbonChat, and supported vanish plugins are optional.

Install

  1. Download CommandPrompter from SpigotMC, Modrinth, or the GitHub releases.

  2. Place the downloaded .jar in the server's plugins directory.

  3. Start or restart the server.

  4. Confirm that CommandPrompterPaper enabled without errors, then edit plugins/CommandPrompterPaper/config.yml and plugins/CommandPrompterPaper/prompt-config.yml as needed.

Anvil and Sign prompts use version-specific screen providers. If no provider matches the server version, those prompts fall back to chat and a warning is written to the console.

Prompt and Session Arguments

Prompt flags apply to one prompt; session tags run after the whole flow completes or is cancelled.

Argument
Syntax
Scope
Description

Chat

<Display>

Multiple prompt flags can be combined as whitespace-delimited tokens. Compound Dialog flags apply to the whole block, and every input row consumes its own answer index.

Prompt

Captures the next chat message.

Anvil

<a:Display>

Prompt

Opens an Anvil input.

Sign

<s:Display>

Prompt

Opens a Sign input.

Player UI

<p:Display> or <p:filter:Display>

Prompt

Selects an online player.

Dialog

<d:filter:Display>

Prompt

Opens a native Paper dialog.

Preset

<@id>

Prompt

Loads a prompt from presets.json.

Disable sanitation

-ds

Prompt

Preserves session input from the normal sanitizer.

Validation

-iv:<alias>

Prompt

Applies a configured validator.

Integer

-int

Prompt

Requires a signed 32-bit integer.

Nonblank string

-str

Prompt

Rejects blank input.

Title display

-t or -t:Main|Sub|ticks

Prompt

Shows an Adventure title before the prompt.

On completion

<!command>

Session

Runs an inline post-command after success.

On cancellation

<!!command>

Session

Runs an inline post-command after cancellation.

Delayed post-command

<!:ticks command>

Session

Delays an inline post-command.

Post-command preset

<!@id>

Session

Loads a post-command definition from presets.json.

/example <d:choice[set,add]:Action && d:num[0,24]:Value -iv:request -t:"Request"> <!audit {0} {1} @console>

CommandPrompter Configuration

This section covers the configuration options available in config.yml.

config.yml is used for global plugin settings. To configure individual prompts, edit prompt-config.yml. See for details.

Prompts Configuration

Commands and Permissions

All administrative commands except the delegates are children of /commandprompter (alias /cmdp).

Commands

Command
Alias
Sender
Description
Permission

Delegate targets accept player names and single-target Minecraft selectors such as @p. The commands use Paper's singular player argument, so multi-target selectors such as @a are rejected.

When Enable-Permission is enabled, a prompted delegate flow starts only if the target has promptpaper.use; the console sender's delegate permission does not bypass that target-side gate. A direct delegated command with no prompt tags is still dispatched.

The permission declarations treat permissions as operator-only by default, except promptpaper.cancel which defaults to true (changed in 3.2.0).

Permission
Description
Default

/commandprompter

/cmdp

Any

Shows CommandPrompter help.

None

/cmdp reload

None

Any

Cancels all active sessions, then reloads both YAML files, the parser, locales, and presets.json.

promptpaper.reload

/cmdp cancel

None

Player

Cancels only the sender's active prompt session.

promptpaper.cancel

/cmdp version

None

Any

Shows the plugin version.

promptpaper.version

/consoledelegate <target> <command...>

/cd

Console only

Prompts the target player, then executes the completed command as console.

promptpaper.consoledelegate

/playerdelegate <target> <permission-key> <command...>

/pd

Console only

Prompts the target player, then executes the completed command as that player with the configured temporary permissions.

promptpaper.playerdelegate

promptpaper.admin

Master permission that grants every permission below (promptpaper.reload, promptpaper.cancel, promptpaper.version, promptpaper.use, promptpaper.consoledelegate, promptpaper.playerdelegate, promptpaper.pcm.console).

OP

promptpaper.reload

Allows /cmdp reload.

Reload cancels every active prompt session before publishing the new configuration.

Permissions

OP

promptpaper.cancel

Allows /cmdp cancel to cancel the sender's own active prompt session (changed to true in 3.2.0).

true

promptpaper.version

Allows /cmdp version.

OP

promptpaper.use

Allows prompt interception when Enable-Permission is enabled.

OP

promptpaper.consoledelegate

Allows the console delegate command. The command also has a console-only sender restriction.

OP

promptpaper.playerdelegate

Allows the player delegate command. The command also has a console-only sender restriction.

OP

promptpaper.pcm.console

Gates post-commands that execute as console (added in 3.2.0).

OP

Prompt-Timeout

Sets how many seconds a player has to answer each individual prompt.

Prompt-Timeout: 300
  • Type: Integer

  • Default: 300 seconds

A fresh fixed timer starts whenever the next prompt screen opens. A value of 0 or less disables timeouts. When a timer expires, the session is cancelled; the timeout message is shown only when Show-Prompt-Cancelled is enabled.

Session Argument

Session arguments affect the full prompt flow. CommandPrompter currently uses post-command tags:

Syntax
Result

<!command>

Runs after successful completion.

<!!command>

Inline post-commands use zero-based answer references ({0}, {1}, ...). They require at least one actual prompt in the same command; a post-command tag by itself does not start a session.

See for executor inheritance, preset placeholders, and lifecycle rules.

Runs after cancellation.

<!:20 command>

Runs after completion with a 20-tick delay.

<!!:20 command>

Runs after cancellation with a 20-tick delay.

<!command @console>

Forces console execution.

<!command @player>

Forces player execution.

<!@id>

References a post-command preset.

Post Command
/ban <Who should be banned?> <Reason?> <!broadcast {0} was banned: {1}>

Enable-Permission

Enables permission checks before a player can use the command prompting feature.

Configuration

Enable-Permission: true
  • Type: Boolean

  • Default: true (Default changed from false to true in 3.2.0)

Description

When set to true (the default in 3.2.0), players must have the promptpaper.use permission to trigger prompt interception.

Usage

CommandPrompter intercepts a player's command when it contains prompt tags, pauses execution, collects the answers in order, substitutes them into the command, and dispatches the completed result.

By default, tags use angle brackets:

/ban <Who should be banned?> <Reason?>

If the answers are Steve and Griefing, the final command is /ban Steve Griefing.

Prompt types

Add a key at the start of a tag to choose a UI:

Key
Prompt

Keys configured in screen-mappings (prompt-config.yml) route to their configured built-in screen type. Third-party plugins can also register keys. An unknown or misspelled key now fails closed: CommandPrompter cancels interception and logs the unresolved key instead of silently opening Chat.

Reusable prompt definitions can be referenced with <@preset_id>. See .

For multi-stage workflows, see for target approvals, conditions, post-action transformers, and early termination.

Menu plugins such as DeluxeMenus can put inline tags directly in player commands:

Some menu plugins dispatch commands without a player command event. In that case, use a or :

Use %target_player% inside delegated commands when the target's name must be inserted into the completed command.

Argument-Regex is the legacy name of the delimiter setting; only its first and last characters are used. With default < > delimiters, Ignore-MiniMessage: true keeps recognized standard MiniMessage tags from becoming prompts.

To include a literal configured delimiter, prefix it with a backslash (\< or \> by default). Reload after changing delimiter or MiniMessage settings.

For flags, validation, title displays, and post-command tags, continue with .

Empty

a:

s:

p:

d:

'ban_button':
  material: BARRIER
  slot: 13
  display_name: '&cBan a Player'
  left_click_commands:
    - '[close]'
    - '[player] ban <a:Who should be banned?> <Reason?>'
left_click_commands:
  - '[close]'
  - '[console] consoledelegate %player_name% ban <a:Who should be banned?> <Reason?>'

Menu plugin integration

Delimiters and MiniMessage

custom screen
Presets
Command Flows
Console Delegate
Player Delegate
Arguments

c:, confirm:

i:, item:

Chat
Anvil UI
Sign UI
Player UI
Dialog UI
Confirmation
Item Selector

Prompt-Prefix

Sets the prefix on the first line of a Chat prompt.

  • Type: String

  • Default: <gradient:gold:yellow>[Prompter]</gradient>

MiniMessage and legacy & color codes are supported. The prefix is not added to GUI prompts, command feedback, or every localized plugin message. In a multiline Chat prompt, it appears only on the first line.

Prompt-Prefix: '<gradient:gold:yellow>[Prompter]</gradient> '

Argument-Regex

Despite its legacy name, Argument-Regex is not evaluated as a regular expression. CommandPrompter trims the value and uses only its first and last characters as the opening and closing prompt delimiters. The middle characters are ignored.

Argument-Regex: <.*?>
  • Type: String of at least three characters

  • Default: <.*?>

  • Effective delimiters: < and >

Examples:

Value
Effective syntax

Each delimiter must be one character. An invalid value logs an error and falls back to < >. Run /cmdp reload after changing it.

In command text, prefix a delimiter with a backslash when it should be literal rather than start or end a tag. This escaping belongs in the command being parsed, not in the Argument-Regex configuration value.

<.*?>

<prompt>

{.*?}

{prompt}

[.*?]

[prompt]

(anything)

(prompt)

Syntax

The Syntax section in config.yml controls prompt delimiters and post-action template placeholders:

Syntax:
  Prompt:
    Open: '<'
    Close: '>'
  Template:
    Open: '{'
    Close: '}'
    Transform-Separator: ':'
    Escape: '\'

With these defaults, <a:Name> is a prompt tag, {0} is the first answer in a post-action template, {0:upper} applies a transformer, and \{ inserts a literal template opener.

Argument-Regex remains as a deprecated compatibility setting for prompt delimiters. When Syntax.Prompt still has its defaults and Argument-Regex was customized, CommandPrompter derives the effective opening and closing characters from the legacy value. Prefer Syntax.Prompt for new configuration.

Each syntax token must be nonempty, no more than 16 characters, and contain no whitespace, control characters, or quotes. Tokens cannot be equal or overlap by prefix. A conflicting syntax configuration rejects reload and leaves the previous validated parser active.

Changing template delimiters also changes placeholders and transformers in trusted definitions such as presets.json. Keep the configured syntax consistent anywhere commands are authored.

Arguments

Arguments are special tags or flags added to a prompt to customize its behavior or the behavior of the entire command execution.

CommandPrompter supports two types of arguments:

  1. : Modify the behavior or appearance of a specific prompt (e.g., UI type, input validation).

  2. : Modify the outcome or behavior of the entire command flow (e.g., running post-commands).

Prompt Arguments
Session Arguments

Show-Prompt-Cancelled

Controls whether CommandPrompter sends feedback when a prompt session is cancelled or times out.

  • Type: Boolean

  • Default: true

Disabling this suppresses both the normal cancellation message and the timeout message. It does not prevent the session from being cancelled.

Show-Prompt-Cancelled: true

Show-Complete-Command

Determines whether CommandPrompter sends the fully constructed command to the player in chat before executing it.

  • Type: Boolean

  • Default: true

Show-Complete-Command: true

Configuration

Cancel-Keyword

Sets the answer that cancels an active prompt.

Cancel-Keyword: cancel
  • Type: String

  • Default: cancel

Cancel-Keyword governs typed input in Chat and Anvil prompts. Matching is trimmed, color-stripped, and case-insensitive. Typed Dialog answers are checked too: for a compound dialog, entering the keyword in any input row cancels the whole session. Closing an Anvil or Player UI also cancels, and an empty Sign submission cancels. Escape is disabled for native Dialogs, so use Cancel/Exit when the player needs to dismiss one without submitting the keyword.

Clickable cancel controls always execute /cmdp cancel and are independent of Cancel-Keyword.

Ignore-MiniMessage

Prevents recognized standard MiniMessage formatting tags from being interpreted as prompts when angle brackets are also the prompt delimiters.

Ignore-MiniMessage: true
  • Type: Boolean

  • Default: true

This setting is active only when Argument-Regex produces < and > delimiters. Valid standard tags such as <red>, </red>, and <gradient:gold:yellow> remain in the command instead of opening prompt sessions. Unknown angle-bracket content is still treated as a prompt.

Run /cmdp reload after changing this setting.

Command-Tab-Complete

Controls whether CommandPrompter's top-level commands are advertised to players in command completion.

Command-Tab-Complete: true
  • Type: Boolean

  • Default: true

When disabled, commandprompter, cmdp, consoledelegate, cd, playerdelegate, and pd are removed from the command list sent to players. This does not change permissions and is unrelated to the Dialog d:tab input.

Ignored-Commands

Specifies a list of commands that CommandPrompter will completely ignore and bypass when checking for prompt patterns.

Configuration

Ignored-Commands:
  - sampleCommand
  - sampleCommand2
  • Type: List of Strings

  • Default: [sampleCommand, sampleCommand2]

Description

Commands on this list will not trigger any prompt detection.

  • Do not include the leading / prefix.

Permission-Attachment

Defines temporary permission groups for Player Delegate.

Permission-Attachment:
  ticks: 0
  Permissions:
    GAMEMODE:
      - bukkit.command.gamemode
      - essentials.gamemode.survival
      - essentials.gamemode.creative

ticks sets how long (in server ticks) the permission attachment persists after a delegated command dispatch (default changed from 1 to 0 in 3.2.0; 0 = removed immediately after dispatch). A positive value schedules removal after that many server ticks; 0 or a negative value removes it immediately. If command dispatch fails, throws an exception, or removal-scheduling fails, the attachment is removed immediately.

Each key under Permissions is passed as the second argument to /playerdelegate. Tab completion for the permission-key argument only suggests actually configured group keys.

Treat every permission group as security-sensitive. Only grant the minimum nodes needed for the delegated command.

ko-fi

Allowed-Commands-In-Prompt

Defines a list of commands players are permitted to run while an active prompt session is open, without canceling the prompt.

Configuration

Allowed-Commands-In-Prompt:
  - sampleCommand
  - sampleCommand2
  • Type: List of Strings

  • Default: [sampleCommand, sampleCommand2]

Important Notes

  • Do not include the leading / prefix.

  • Allowed commands that contain prompts will still be blocked.

Chat Prompt

Controls the settings for Chat Prompt.

  • Clickable-Cancel

  • Cancel-Message

  • Cancel-Hover-Message

Response-Listener-Priority

Debug-Mode

Enables verbose logging for troubleshooting and diagnostics.

  • Type: Boolean

  • Default: false

Debug-Mode: false

Configuration

Locale

Selects the locale used for CommandPrompter messages.

Locale: en_US
  • Type: String

  • Default: en_US

Bundled locales are en_US, es_ES, fr_FR, ja_JP, ko_KR, pirate, pl_PL, pt_BR, tl_PH, and zh_CN.

Custom UTF-8 overrides use this path:

For example, Locale: de_DE loads messages_de_DE.properties. The fallback resolution chain for each message key is:

  1. Custom disk override (plugins/CommandPrompterPaper/locales/messages_<locale>.properties)

  2. Bundled JAR resource for the selected locale

  3. Bundled en_US default

PlaceholderAPI placeholders inside message values expand against the receiving player (player context is passed to localized feedback). Run /cmdp reload after changing the locale or an override file.

plugins/CommandPrompterPaper/locales/messages_<locale>.properties

Fancy-Logger

Enables ANSI color coding and stylized formatting for console logs.

  • Type: Boolean

  • Default: true

Fancy-Logger: true

Configuration

Prompts Configuration

prompt-config.yml contains the UI defaults for Chat, Player, Anvil, Sign, Dialog, and Confirmation prompts, plus input-validation definitions.

The file is generated in plugins/CommandPrompterPaper/ on first start. Edit it while the server is stopped or use /cmdp reload after saving changes. Reload cancels active prompt sessions.

The screen-mappings section is honored during inline prompt routing. A configured key maps to CHAT, ANVIL, SIGN, DIALOG, PLAYER, CONFIRMATION, or ITEM. Built-in aliases remain reserved: the empty Chat key, a

Continue with the page for the UI you want to configure:

  • Chat Prompt

/
anvil
,
s
/
sign
,
p
/
player
,
d
/
dialog
,
c
/
confirm
/
confirmation
, and
i
/
item
. Other keys must be mapped or registered by a
; unresolved keys fail closed instead of falling back to Chat.
Player UI
Anvil UI
Sign UI
Dialog UI
Confirmation Prompt
Item Selector Prompt
custom screen provider

Cancel-Message

Specifies the clickable text message displayed for canceling a text prompt.

Edit prompt-config.yml:

TextPrompt:
  Cancel-Message: '&7[&c&l✘&7]'

Configuration

Clickable-Cancel

Controls the cancel affordance appended to inline Chat prompts.

TextPrompt:
  Clickable-Cancel: true
  • Type: Boolean

  • Default: true

When enabled (true), CommandPrompter appends Cancel-Message to the prompt text and configures it to run /cmdp cancel with the configured hover text on click. Disabling this setting (false) suppresses the cancel text entirely.

Clicking the cancel control executes /cmdp cancel. Because promptpaper.cancel defaults to true, non-operator players can use the clickable cancel control out of the box. Typing the configured cancel keyword directly in chat never requires a permission.

Chat prompt presets have independent cancel.send and cancel.clickable properties.

Cancel-Hover-Message

Specifies the message shown when a player hovers over the clickable cancel option in a text prompt.

Edit prompt-config.yml:

TextPrompt:
  Cancel-Hover-Message: '&7Click here to cancel command completion'

Configuration

Response-Listener-Priority

Sets the Bukkit event priority used to capture Chat prompt answers.

TextPrompt:
  Response-Listener-Priority: LOWEST
  • Type: String

  • Default: LOWEST (Default changed from DEFAULT to LOWEST in 3.2.0)

Valid Bukkit priorities are LOWEST, LOW, NORMAL, HIGH, HIGHEST, and MONITOR.

This value applies to the fallback Bukkit Chat listener. When the CarbonChat integration owns Chat prompt input, CarbonChat's event subscription is used instead.

Player UI

Configures the visual aspects and behavior of the Player UI Prompt.

  • Skull-Name-Format

  • Skull Custom Model Data

  • Size

Cache-Size
Cache-Delay
PlayerUI Control Items
Search Anvil Item
Sorted
Empty-Message
Filter-Format

Size

Determines the number of slots in the Player UI inventory.

Edit prompt-config.yml:

PlayerUI:
  Size: 54

Configuration

Must be a multiple of 9, with 18 as the minimum and 54 as the maximum.

Cache-Delay

Determines the delay (in ticks) after a player joins before their head is cached.

Edit prompt-config.yml:

The accepted range is 0–2400 ticks. A value of 0 caches the head immediately on join.

PlayerUI:
  Cache-Delay: 1

Configuration

If player heads are not appearing in the Player UI, try increasing this delay.

Cache-Size

  • Type: Integer

  • Default: 256

Cache-Size sets the maximum capacity of the bounded LRU cache used to store rendered player head item stacks (<= 0 creates an unbounded cache).

The list of displayed players in the Player UI is always derived fresh from online players at open time. Cache eviction only clears cached skull items from memory and never hides online players from the UI.

PlayerUI:
  Cache-Size: 256

PlayerUI Control Items

Configure the buttons used for navigation and cancellation in the Player UI (Previous, Next, Cancel, and Search).

Configuration

Edit prompt-config.yml:

PlayerUI:
  Previous:
    Item: Feather
    Custom-Model-Data: 0
    Column: 3
    Text: '&7◀◀ Previous'
  Next:
    Item: Feather
    Custom-Model-Data: 0
    Column: 7
    Text: 'Next ▶▶'
  Cancel:
    Item: Barrier
    Custom-Model-Data: 0
    Column: 5
    Text: '&7Cancel ✘'
  Search:
    Item: Name_Tag
    Custom-Model-Data: 0
    Column: 9
    Text: '&6Search ⌕'

Options

  • Item: The Minecraft material for the button item. Must be a valid material from the Minecraft Materials list.

  • Custom-Model-Data: The custom model data value for the item.

  • Column: The 1-based inventory column (1–9) in the bottom control row, mapping to zero-based inventory slots 0–8 (e.g. Column 3 maps to slot 2). Out-of-range values are clamped to the 1–9 range with a console warning.

  • Text: The display name of the button item.

Control
Default Item
Default Column (1–9)
Inventory Slot (0–8)
Default Display Text

Previous

Feather

3

2

Default Placement

&7◀◀ Previous

Cancel

Barrier

5

4

&7Cancel ✘

Next

Feather

7

6

Next ▶▶

Search

Name_Tag

9

8

&6Search ⌕

Skull Custom Model Data

Specifies the custom model data for player heads displayed in the Player UI.

Edit prompt-config.yml:

PlayerUI:
  Skull-Custom-Model-Data: 0

Configuration

Search Anvil Item

When a player clicks the Search button in the Player UI, CommandPrompter opens an Anvil GUI styled using these settings (Title, Material, CustomModelData, and prefilled Text). Submitting a query in the Anvil filters the displayed heads.

Chat capture is used only as a fallback when no NMS screen provider is available on the server.

Configure the visible Search button in the Player UI inventory on .

PlayerUI:
  Search:
    AnvilItem:
      Title: '&6&lPlayer Search'
      Material: PAPER
      CustomModelData: 0
      Text: '&6Enter Player Name'
PlayerUI Control Items

Empty-Message

  • Type: String

  • Default: &cNo players found!

When a player list or search filter results in 0 matching players, a single non-clickable BARRIER item displaying this message is rendered in the center of the head inventory grid.

PlayerUI:
  Empty-Message: '&cNo players found!'

Sorted

Determines whether player heads in the Player UI are sorted alphabetically by player name.

Edit prompt-config.yml:

PlayerUI:
  Sorted: false

Configuration

Filter-Format

%s represents a player's name. Formatting supports MiniMessage tags and legacy color codes.

When a filter is applied to a Player UI prompt, head display names use the configured format of the leftmost (first) filter token (for example, w uses Filter-Format.World and r uses Filter-Format.Radial). Any subsequent filters in a combined filter string only contribute to narrowing the player set.

If no filter format applies (or when no filter is used), heads retain the global PlayerUI.Skull-Name-Format.

PlayerUI:
  Filter-Format:
    World: '&6𑁍 %s'
    Radial: '&cᯤ %s'

Enable-Title

Determines whether the first line of the prompt (before a {br} line break) is used as the title of the Anvil GUI.

Edit prompt-config.yml:

AnvilGUI:
  Enable-Title: true

Configuration

Anvil UI

Manages the settings related to Anvil UI Prompt.

  • Enable-Title

  • Custom-Title

  • Prompt-Message

Enable-Cancel-Item
Item
Enchanted
HideTooltips
CancelItem HoverText

Prompt-Message

Sets the display name of the input item in an inline Anvil prompt. That item name is also the initial text presented by Minecraft's rename field.

  • Type: String

  • Default: empty

For Anvil presets, left_button.button_text overrides this value.

AnvilGUI:
  Prompt-Message: ''

Max-Answer-Length

Max-Answer-Length limits each submitted prompt answer before it is added to a session.

The default is 256 characters. The accepted configuration range is 1–1024. An answer over the configured limit is rejected with a player-visible validation error and the current prompt remains active for another attempt.

This limit applies to untrusted player input. Other flow resources—including preset templates, PlaceholderAPI values, prompt counts, and condition depth—have separate hard bounds and fail closed when exceeded.

Max-Answer-Length: 256

CancelItem HoverText

This configuration option sets the hover text for the cancel item in the Anvil GUI.

  • Type: String

  • Default: &cClick to Cancel

Sets the text that appears when a player hovers over the cancel item in the Anvil GUI.

AnvilGUI:
  CancelItem:
    HoverText: '&cClick to Cancel'

Configuration

Description

Item

Specifies the items displayed in the Anvil GUI.

  • Item: The item displayed in the input slot.

  • ResultItem: The item displayed in the result slot.

  • CancelItem: The item displayed in the cancel slot (only used when Enable-Cancel-Item is true).

Edit prompt-config.yml:

AnvilGUI:
  Item:
    Material: Paper
    Custom-Model-Data: 0
  ResultItem:
    Material: Paper
    Custom-Model-Data: 0
  CancelItem:
    Material: Barrier
    Custom-Model-Data: 0

Configuration

Material must be a valid material from the list.

Minecraft Materials

Enable-Cancel-Item

This configuration option determines whether a cancel item should be shown on the right input slot of the Anvil GUI.

  • Type: Boolean

  • Default: false

When set to true, a cancel item will be displayed in the Anvil GUI, allowing players to easily cancel the prompt.

AnvilGUI:
  Enable-Cancel-Item: false

Configuration

Description

HideTooltips

This configuration option hides the additional tooltip on Anvil GUI items.

  • Type: Boolean

  • Default: false

When set to true, the tooltips for the respective items in the Anvil GUI will be hidden. This is useful for creating a cleaner UI.

AnvilGUI:
  Item:
    HideTooltips: false
  ResultItem:
    HideTooltips: false
  CancelItem:
    HideTooltips: false

Configuration

Description

Custom-Title

Sets a custom title for the Anvil GUI (used when Enable-Title is enabled).

Edit prompt-config.yml:

AnvilGUI:
  Custom-Title: ""

Configuration

Item Catalogs

plugins/CommandPrompterPaper/item-catalogs.yml defines the read-only choices shown by item prompts using -source:catalog.

The file is extracted on first start. It must contain an all category:

Use a category from an item prompt:

Validation rules

  • Category IDs must match ^[a-z0-9_.-]{1,64}$.

  • all is required.

  • The file may contain at most 256 categories and be at most 1 MiB.

  • Each category may contain at most 1024 entries.

  • Every entry must resolve to a valid item material on the running server.

  • Duplicate entries inside one category are rejected.

Catalog screens show 45 entries per page. A catalog selection can return key, material, or amount; slot is invalid because a catalog item has no player inventory slot. Catalog amount is always 1.

Run /cmdp reload after editing the file. Reload validates the complete file before publishing it. If validation fails, CommandPrompter keeps the previous catalog snapshot active and reports the error instead of partially applying the edit.

categories:
  all:
    - minecraft:stone
    - minecraft:diamond_sword
    - minecraft:golden_apple

  combat:
    - minecraft:iron_sword
    - minecraft:diamond_sword
    - minecraft:shield

  food:
    - minecraft:golden_apple
    - minecraft:bread
/kit reward <i:Choose a reward -source:catalog -cat:combat -out:key>

Material

Specifies the material used for signs in the Sign UI.

Configuration

Edit prompt-config.yml:

Valid Values

Must be a valid Minecraft material (typically containing _SIGN). For a list of valid materials, refer to the Minecraft Materials documentation. Common examples:

  • OAK_SIGN

  • SPRUCE_SIGN

  • BIRCH_SIGN

  • ACACIA_SIGN

SignUI:
  Material: OAK_SIGN

Input-Field-Location

Controls how inline Sign prompt text and writable rows are arranged.

SignUI:
  Input-Field-Location: bottom
  • Type: String

  • Default: bottom

Value
Layout & Semantics

In single-argument mode, unchanged prompt lines and empty lines are filtered out before combining the answer. In labeled multi-argument mode (label1:\nlabel2:), CommandPrompter extracts and joins the text following each label:.

bottom

Up to 3 prompt lines occupy lines 1–3 (indices 0–2); player input is read from line 4 (index 3).

top

Line 1 (index 0) is the input line; up to 3 prompt lines occupy lines 2–4 (indices 1–3).

bottom-aggregate

Prompt lines ($N \le 3$) occupy lines 0 to $N-1$; remaining lines $N$ to 3 accept input. All non-prompt, non-empty input lines are concatenated with spaces.

top-aggregate

Prompt lines ($N \le 3$) occupy bottom lines $(4-N)$ to 3; lines 0 to $(3-N)$ accept input. All non-prompt, non-empty input lines are concatenated with spaces.

Enchanted

Determines whether items in the Anvil GUI display with an enchanted visual effect.

Configuration

Edit prompt-config.yml:

AnvilGUI:
  Item:
    Enchanted: false
  ResultItem:
    Enchanted: false
  CancelItem:
    Enchanted: false

Options

  • Item.Enchanted: Controls the main input item.

  • ResultItem.Enchanted: Controls the result item.

  • CancelItem.Enchanted: Controls the cancel item.

Sign UI

Defines the configuration for the .

Sign UI Prompt
Input-Field-Location
Material

Internationalization (I18N)

Set Locale in config.yml and reload:

Locale: en_US

Bundled locales are en_US, es_ES, fr_FR, ja_JP, ko_KR, pirate, pl_PL, pt_BR, tl_PH, and zh_CN.

Create a UTF-8 properties file named:

Only overridden keys are required. Resolution for each key is:

  1. the on-disk selected-locale override;

  2. the selected locale bundled in the plugin;

  3. bundled en_US.

Values support MiniMessage, built-in %name% substitutions, and PlaceholderAPI expansion against the receiving player (player context is passed to localized messages). Run /cmdp reload after changing the locale or file.

Key
Description
Placeholder(s)
plugins/CommandPrompterPaper/locales/messages_<locale>.properties

prompt.cancelled

Prompt session was cancelled.

None

prompt.timed_out

Custom translations

Message keys

Prompt answer timer expired.

None

prompt.error.invalid_title_filter

Standalone title or body Dialog layout filter.

None

prompt.error.session_active

A player already has an active session.

None

prompt.error.command_failed

Final command dispatch failed.

%message%

validation.invalid_integer

-int validation failed.

None

validation.invalid_string

-str validation failed.

None

player_ui.search_instruction

Player UI search instruction.

None

dialog.no_options

Dialog tab completion returned no options.

None

dialog.too_many_options

Dialog tab completion exceeded its threshold.

%count%

command.error.players_only

A player-only command was used by another sender.

None

command.error.missing_preset

A referenced preset was not found.

None

command.error.missing_validator

An unknown input validator is referenced.

None

command.cancel.no_active_prompt

No active session exists to cancel.

None

command.delegate.unknown_permission

Unknown Player Delegate permission group.

%key%

command.reload.success

Reload succeeded.

None

command.reload.failed

Reload failed.

%error%

command.version

Installed plugin version.

%version%

Chat Prompt

Chat is the default prompt and has no key.

/gamemode <&6&lWhat gamemode?{br}0. Survival{br}1. Creative>

{br} splits the display into separate chat messages. Prompt-Prefix is added to the first line, and the configured cancel control is appended to the last line. The clickable cancel control runs /cmdp cancel (which all players can use by default as promptpaper.cancel defaults to true in 3.2.0).

The player's next chat message becomes the answer. Typing the configured Cancel-Keyword also cancels the session and does not require command permissions. MiniMessage and legacy color codes are supported in the display text; normal answer sanitation is controlled by -ds.

Capability
Behavior

Prompt key

Empty

Line breaks

{br}

Display formatting

MiniMessage and legacy codes

Configuration

Chat Prompt settings

Dialog UI

The Dialog UI uses Paper's native dialog API. These values are defaults for inline <d:...> prompts; inline constraints and preset fields can override them.

DialogUI:
  Title: Prompt
  Confirm-Button:
    Label: <green>Confirm</green>
    Tooltip: Confirm this action
  Cancel-Button:
    Label: <red>Cancel</red>
    Tooltip: Cancel this action
  Defaults:
    Text:
      MaxLength: 256
      Multiline: false
      MultilineMaxLines: 4
      Width: 200
    Choice:
      Default-Options: ''
    Number:
      Min: 0.0
      Max: 100.0
      Step: 1.0
    Tab:
      MaxButtons: 5

Window and buttons

  • Title is the fallback for ordinary inline dialogs when no d:title row overrides it, and it is always used by the d:tab text-input fallback. A successful button-form d:tab instead uses that tag's display text as its window title. (d:tab cannot be combined with the compound-only d:title row.) JSON Dialog presets can supply their own title.

  • Confirm and Cancel labels and tooltips accept MiniMessage and legacy color codes.

  • Prompt dialogs do not close when the player presses Escape or activates a component action such as open_url. Confirm, Cancel, Exit, or an answer button ends the dialog explicitly.

  • MaxLength: 1–8192 characters.

  • Multiline: enables multiline input.

  • MultilineMaxLines: 1–16; used when multiline is enabled.

An inline text[...] filter can override all three numeric values.

Default-Options is a comma-separated fallback for <d:choice:Label>. An explicit choice[one,two] list takes precedence. With no configured or inline options, the client receives one empty option.

Min, Max, and Step must be finite, with Min < Max and Step > 0. The initial value defaults to the midpoint. Inline number constraints can override the range, step, and initial value.

MaxButtons must be 1–256. At or below the threshold, tab completions become buttons. Zero completions or a count above the threshold produces a text-input fallback.

Width: 1–8192 pixels in YAML validation.

Text defaults

Choice defaults

Number defaults

Tab defaults

Anvil UI Prompt

Use a: to capture text through the native Anvil rename interface.

/nick <a:Choose a new nickname>

For inline prompts, the display text becomes the Anvil title when titles are enabled and no custom title is configured. If it contains {br}, only the text before the first marker is used as that fallback title; later segments are not rendered as lore.

The player types into the rename field and clicks the output/result slot to submit. Closing the UI, clicking an enabled cancel item, or submitting the configured cancel keyword cancels the session. Sanitization strips color codes by default, but -ds or preset "sanitize": false preserves them.

Preset support

Anvil preset definitions in presets.json are fully wired in 3.2.0:

  • title: Sets the Anvil window title.

  • prompt_text / left_button.button_text: Sets the initial text in the rename field.

  • left_button.*: Configures the input item (show, button_text, button_icon, button_hover_text, custom_model_data).

  • right_button.*: Configures the cancel item (show, button_text, button_icon, button_hover_text, custom_model_data).

Anvil prompts use version-specific providers for Minecraft 26.1.2 and 26.2.x. If a compatible provider cannot open, CommandPrompter falls back to a Chat prompt.

Capability
Behavior

Prompt key

a:

Display formatting

MiniMessage and legacy codes

Configuration

Anvil UI settings

Skull-Name-Format

Specifies the display name format for player heads in the Player UI.

Edit prompt-config.yml:

  • The %s placeholder represents the player's name and is replaced dynamically.

PlayerUI:
  Skull-Name-Format: '&6%s'

Configuration

Player UI Prompt

Use p: to show a paginated inventory of visible online players. Clicking a head returns that player's name.

/mute <p:Who should be muted?>

Use <p:filter:Display text> for one player filter:

/teleport <p:w:Choose someone in your world>

Filters

Filter
Key
Requires
Result

Only filters whose optional integration is installed are registered. Multiple filter tokens can be combined and will compose (intersect) — for example, r10s selects players within 10 blocks AND excludes the prompting player. The filter parser uses an anchored longest-match tokenizer, ensuring that specific keys (such as wgr or wgrm...;) are matched correctly without being shadowed by shorter keys like w. If a filter token is not recognized, it is skipped.

  • Search: Clicking the Search button opens an Anvil GUI configured via PlayerUI.Search.AnvilItem.* for entering a name filter. If no NMS anvil provider is available, it gracefully falls back to chat input. Matching heads are then displayed in the updated grid.

  • Empty State: When no online players match the filter or search query, a non-clickable BARRIER item is displayed in the center of the inventory with PlayerUI.Empty-Message.

Closing the inventory or clicking Cancel cancels the prompt session.

See .

Presets

presets.json defines reusable prompts, post-commands, approval gates, and conditional post-commands. CommandPrompter extracts a sample file to plugins/CommandPrompterPaper/presets.json on first start and reloads it with /cmdp reload.

Use this root shape for schema-compatible files:

The runtime treats an absent array as empty, although the documentation schema requires prompts and post_commands. The file is limited to 1 MiB and each array to 256 definitions. A failed load keeps the previous in-memory preset snapshot.

IDs are case-sensitive, must be nonempty, and must be unique across all four definition kinds. Duplicate and cross-kind collisions reject the complete reload. Prompt and post-command IDs should not contain whitespace because <@id>

Head Cache & Vanish: PlayerUI.Cache-Size configures a bounded LRU cache for player head item stacks (<= 0 for unbounded). The player list is always derived fresh from online players, meaning cache eviction never hides online players. Vanish integrations (SuperVanish, PremiumVanish, VanishNoPacket) are enforced at the cache boundary: vanished players are never cached and never appear in filtered or unfiltered views.

World

w

Nothing

Players in the prompting player's world

Radius

r<number>

Nothing

Players within that many blocks in the same world

Exclude self

s

Nothing

All online players except the prompting player

Towny town

tt

Towny

Online members of the prompting player's town

Towny nation

tn

Towny

Online members of the prompting player's nation

HuskTowns town

ht

HuskTowns

Online members of the prompting player's town

Own primary group

lpo

LuckPerms

Players with the same primary group

Named primary group

lpg<group>;

LuckPerms

Players whose primary group is group

Shared region

wgr

WorldGuard

Players sharing a region with the prompting player

Region members

wgrm<region-id>;

WorldGuard

Online members of that region

Region owners

wgro<region-id>;

WorldGuard

Online owners of that region

Search and Empty State

Player UI settings
and
<!@id>
stop at the first space. Approval-gate and conditional post-command IDs must match
^[a-z0-9_.-]{1,64}$
. When drafting commands in chat,
<@
tab-completes prompt preset IDs and
<!@
tab-completes post-command preset IDs.

Every prompt has:

Field
Required
Description

type

Yes

chat, anvil, player_ui, sign, dialog, confirmation, or item

id

Yes

title_display supports:

main is required by the schema; an empty value uses the prompt's normal display text. sub and ticks are optional. The screen opens after 70 ticks when ticks is omitted, and that delay counts against Prompt-Timeout.

Required fields are prompt_text and cancel:

send controls whether the cancel component appears; clickable controls whether that preset component runs the cancel command. Clicking the cancel component executes /cmdp cancel. The promptpaper.cancel permission defaults to true, so all players can use clickable cancel controls. Typing the cancel keyword does not require any permission.

Anvil preset fields:

  • title: Anvil window title.

  • prompt_text: Default text placed in the input rename field (falls back to left_button.button_text if empty).

  • left_button.*: Configures the left input item:

    • show: whether to place the item in the left slot.

    • button_text: default text / display name.

    • button_icon: material name (e.g. PAPER).

  • right_button.*: Configures the cancel item in the right slot:

    • show: whether to enable the cancel item.

    • button_text: display name for the cancel item.

  • Submitting the result/output slot yields the rename text. right_button acts as the cancel button.

Invalid material names fall back to PAPER.

filter uses the same syntax as inline Player UI prompts. cancel_button, previous_button, and next_button are optional overrides. When an override is absent, the YAML control is used; show: false hides that preset control. slot is 0-based within the 9-slot control row (enforced in 0–8). button_hover_text renders as lore on the control item (supports line breaks with {br} or \n).

The Search control always comes from prompt-config.yml.

default_lines is optional and should contain at most four strings. When present and nonempty, it supplies the sign contents directly. Otherwise prompt_text is split on {br} and arranged using the Sign YAML settings. prompt_text is not sent to chat unless the native Sign provider falls back to Chat.

A Dialog preset mirrors Paper's native dialog model:

base.body accepts:

  • plain_message: content plus optional width (1–1024).

  • item: Bukkit material and optional amount (defaults to 1 and must be positive). Invalid materials fall back to PAPER.

Each base.inputs row requires label and input_type:

Input type
Fields

text

Optional max_length (1–8192), max_lines (1–16), and width (1–8192). Values default from DialogUI. constraints is ignored.

number

constraints positions are [min,max,step,initial]. Missing values use YAML defaults; invalid ranges and initial values are normalized.

choice

Multi-input dialog presets produce $N$ answers (one per base.inputs entry), which can be referenced individually via {input:1} through {input:N} in post-commands or appended in order to the dispatched command. Info-only dialogs (zero input rows) produce 0 answers. {input:N} indices are never shifted by layout or body rows.

confirmation uses:

  • required schema field confirm_action;

  • optional cancel_action.

Confirm submits the configured input row or rows. Cancel cancels the session. Missing buttons fall back to the YAML labels at runtime.

multi_action uses:

  • columns, at least 1;

  • exactly one of actions or actions_source;

  • optional exit_action, which customizes the button that cancels the session. An exit button is still shown when this field is omitted, using the YAML Cancel label and tooltip.

An action has required label and optional tooltip and return. A static action submits return, or its label when return is absent. Static action buttons do not submit base.inputs, so avoid mixing the two interaction models.

Dynamic button generation uses:

When "actions_source": "tab_completion" is configured, multi-action buttons populate dynamically from Brigadier tab-completion suggestions for the preceding command arguments. If completions are available and within the MaxButtons threshold, each suggestion is rendered as a clickable button. When completions exceed the threshold or none are available, the dialog falls back to a text input field.

Leave base.inputs empty when using actions_source. That fallback is a confirmation layout using the normal Confirm and Cancel buttons; a configured exit_action is not used there.

Native prompt dialogs keep client component actions such as open_url open and cannot be closed with Escape. Confirm, Cancel, Exit, and answer buttons explicitly close the screen; timeout, /cmdp cancel, reload, disconnect, and other server-side teardown can also close it. Opening a link does not reset Prompt-Timeout.

prompt_text is required. mode accepts gui, dialog, or chat; an omitted mode uses ConfirmationUI.Default-Mode. In normal gate mode, Confirm advances with zero answers and Decline cancels the flow. Set value_mode to true to contribute one true/false answer instead. timeout must be 1–3600 seconds.

See Confirmation Prompt for inline syntax and UI configuration.

source accepts inventory/inv, hand/mainhand, armor, or catalog and defaults to inventory. output accepts key, material, slot, or amount and defaults to key. category is valid only for catalogs and defaults to all; catalog prompts cannot use slot output. timeout must be 1–3600 seconds.

See Item Selector Prompt and Item Catalogs.

Field
Values

id

Case-sensitive preset ID

command

Command without a leading slash

execution_policy

Placeholders:

  • {input} / {input:1}: first answer

  • {input:N}: Nth answer, one-based

  • {0}, {1}, ...: zero-based answer aliases

  • {player}: prompting/target player's name

  • PlaceholderAPI %...% values when installed

Append one transformer to an answer reference, for example {input:1:upper}, {0:trim}, or {1:math(*1.5)}. Available transformers are upper, lower, capitalize, trim, stripcolor, default="...", math(...), and round. Transformers cannot be chained.

The preset's policy, executor, and delay override any marker or delay written on the <!@id> reference. PlaceholderAPI values are expanded only for trusted preset actions; inline post-command strings treat %...% literally.

Place definitions in approval_gates and reference them with <!gate:@trade_confirm>. target and message use {player} and zero-based answer placeholders. timeout defaults to 30 and must be 1–3600 seconds. self_approval_policy is auto_approve (default) or require_confirm. on_deny is optional; its delay_ticks must be 0.

Gate IDs are lowercase and match ^[a-z0-9_.-]{1,64}$. Unknown IDs and free-form inline gate definitions fail closed. See Command Flows for lifecycle details.

Place definitions in conditional_post_commands and reference them with <!@large_payment>. execution_policy is on_complete or on_cancel. At least one branch is required; an omitted branch performs no action when selected. Each branch supports command, execute_as, and delay_ticks from 0 through 72000.

Conditions use zero-based answers and support numeric comparisons, equals, contains, startsWith, endsWith, &&, ||, unary !, and parentheses. Trusted conditions may contain PlaceholderAPI references. Invalid syntax or an unresolvable operand rejects the flow rather than being treated as false. See Command Flows.

  • /cmdp reload cancels active sessions and reloads the file.

  • A malformed reload reports the failing array position/ID and preserves the previous preset registry.

  • Duplicate IDs, including IDs reused by another definition kind, reject the entire reload.

  • Any missing referenced prompt, post-command, conditional post-command, or approval-gate preset aborts that command flow instead of dispatching the literal tag.

  • Repeating the same post-command preset reference dispatches that ID at most once per lifecycle event.

The repository's schema/presets.schema.json is documentation and editor support; runtime loading does not validate the file against JSON Schema.

{
  "prompts": [],
  "post_commands": [],
  "approval_gates": [],
  "conditional_post_commands": []
}
"title_display": {
  "main": "Review Request",
  "sub": "Complete every field",
  "ticks": 70
}
{
  "type": "chat",
  "id": "reason",
  "prompt_text": "Enter a reason:",
  "sanitize": true,
  "cancel": {
    "send": true,
    "message": "<gray>[<red>Cancel</red>]</gray>",
    "clickable": true,
    "hover_message": "Cancel this request"
  }
}
{
  "type": "anvil",
  "id": "rename",
  "title": "Rename item",
  "prompt_text": "Enter a name",
  "sanitize": false,
  "left_button": {
    "show": true,
    "button_text": "New Name",
    "button_icon": "PAPER",
    "button_hover_text": "Enter the new name",
    "custom_model_data": 0
  },
  "right_button": {
    "show": true,
    "button_text": "Cancel",
    "button_icon": "BARRIER",
    "button_hover_text": "Cancel this prompt",
    "custom_model_data": 0
  }
}
{
  "type": "player_ui",
  "id": "target",
  "prompt_text": "Choose a player",
  "filter": "w",
  "sanitize": true,
  "cancel_button": {
    "show": true,
    "slot": 4,
    "button_text": "Cancel",
    "button_icon": "BARRIER",
    "button_hover_text": "Cancel this prompt",
    "custom_model_data": 0
  }
}
{
  "type": "sign",
  "id": "pin",
  "prompt_text": "Enter your PIN",
  "sanitize": true,
  "default_lines": ["Enter PIN", "", "", ""]
}
{
  "type": "dialog",
  "id": "ban_form",
  "title": "Ban Player",
  "sanitize": true,
  "base": {
    "body": [
      {
        "type": "plain_message",
        "content": "<gray>Review the request before confirming.</gray>",
        "width": 300
      },
      {
        "type": "item",
        "material": "BARRIER",
        "amount": 1
      }
    ],
    "inputs": [
      {
        "label": "Reason",
        "input_type": "text",
        "max_length": 512,
        "max_lines": 5,
        "width": 300
      }
    ]
  },
  "dialog_type": {
    "type": "confirmation",
    "confirm_action": {
      "label": "<green>Confirm</green>",
      "tooltip": "Submit the form"
    },
    "cancel_action": {
      "label": "<red>Cancel</red>"
    }
  }
}
"dialog_type": {
  "type": "multi_action",
  "columns": 2,
  "actions": [
    {"label": "Survival", "return": "survival"},
    {"label": "Creative", "return": "creative"}
  ],
  "exit_action": {"label": "Cancel"}
}
"actions_source": "tab_completion"
{
  "type": "confirmation",
  "id": "confirm_delete",
  "mode": "gui",
  "title": "Confirm Delete",
  "prompt_text": "Delete this entry?",
  "confirm_text": "Delete",
  "cancel_text": "Keep",
  "value_mode": false,
  "sound": "minecraft:block.note_block.bell",
  "sanitize": true,
  "timeout": 30
}
{
  "type": "item",
  "id": "reward_item",
  "prompt_text": "Choose a reward",
  "source": "catalog",
  "output": "key",
  "category": "combat",
  "sound": "minecraft:block.note_block.pling",
  "sanitize": true,
  "timeout": 45
}
{
  "id": "audit",
  "command": "broadcast {player} selected {input:1}",
  "execution_policy": "on_complete",
  "execute_as": "console",
  "delay_ticks": 20
}
{
  "id": "trade_confirm",
  "target": "{0}",
  "message": "{player} wants to trade with you. Accept?",
  "timeout": 30,
  "self_approval_policy": "auto_approve",
  "on_deny": {
    "command": "tell {player} The trade was declined.",
    "execute_as": "player",
    "delay_ticks": 0
  }
}
{
  "id": "large_payment",
  "condition": "{1} >= 500",
  "execution_policy": "on_complete",
  "if_true": {
    "command": "broadcast {player} sent {1}",
    "execute_as": "console",
    "delay_ticks": 0
  },
  "if_false": {
    "command": "tell {player} Payment recorded.",
    "execute_as": "player",
    "delay_ticks": 0
  }
}

Common prompt fields

Chat prompt

Anvil prompt

Player UI prompt

Sign prompt

Dialog prompt

Body

Inputs

Dialog types and actions

Confirmation prompt

Item prompt

Post-command presets

Approval gates

Conditional post-commands

Reload and error behavior

button_hover_text: lore displayed on hover.

  • custom_model_data: custom model data value.

  • button_icon: material name (e.g. BARRIER).

  • button_hover_text: lore displayed on hover.

  • custom_model_data: custom model data value.

  • Unique prompt ID

    sanitize

    No

    When true (default), answers are sanitized (color codes and special characters stripped). When set to false, answers retain legacy color codes and formatting symbols.

    title_display

    No

    Shows an Adventure title before opening the prompt.

    Each nonblank trimmed constraints value becomes one option; the first is initially selected. If none remain, one empty fallback option is inserted.

    on_complete or on_cancel

    execute_as

    console or player

    delay_ticks

    Optional nonnegative integer, default 0

    Sign UI Prompt

    Use s: to collect text through a Sign editor.

    /gamemode <s:What gamemode?>

    Inline display text is split on {br} and placed around writable rows according to SignUI.Input-Field-Location:

    • bottom (default): Prompt text occupies lines 1–3 and player input is captured on line 4.

    • top: Input is captured on line 1 and prompt text occupies lines 2–4.

    • bottom-aggregate: Prompt lines are placed at the top and all remaining bottom lines are aggregated (concatenated with spaces) into the final argument.

    • top-aggregate: Prompt lines are placed at the bottom and all remaining top lines are aggregated (concatenated with spaces) into the final argument.

    In normal mode, single line modes (top, bottom) take the designated input line, while aggregate modes concatenate all non-prompt input lines with spaces.

    Multi-argument mode activates only when at least one {br} segment is exactly a non-space label followed by a colon, such as Mode: or Value:. On submission, each row matching label:anything contributes only the text after its first colon.

    If the player edits the labeled rows to Mode:add and Value:1600, the answer is add 1600.

    Labels containing spaces, or a segment that already has text after its colon, do not activate multi-argument mode. Sign answers always have color codes stripped. An empty result, the cancel keyword, or closing/cancelling the screen cancels the session.

    Sign prompts use version-specific providers for Minecraft 26.1.2 and 26.2.x and fall back to Chat if no compatible provider opens.

    See .

    /time <s:Time Command{br}Mode:{br}Value:>

    Labeled multi-argument mode

    Sign UI settings

    Item Selector Prompt

    Use i: or item: to let a player select an item instead of typing a material or slot.

    /auction create <i:Select an item>

    The screen is read-only. CommandPrompter displays server-side item snapshots, cancels inventory movement, and verifies a physical item again when it is clicked. If the item changes, the player can retry; three consecutive snapshot mismatches cancel the prompt.

    Sources

    Source
    Aliases
    Selection

    Choose the source with -source:<source>:

    The selected item contributes one answer token.

    Output
    Example
    Notes

    Choose the output with -out:<format>:

    Logical slot numbers are 0–8 for the hotbar, 9–35 for main storage, 36–39 for armor (feet through head), and 40 for offhand.

    Flag
    Meaning

    Unknown sources, outputs, and categories fail closed. -cat on a non-catalog source and -out:slot on a catalog also reject the command.

    Reference it with <@combat_reward>. source defaults to inventory, output defaults to key, and a catalog without category uses all.

    See to define catalog categories and reload behavior.

    Inventory

    inv, inventory

    Storage, hotbar, armor, and offhand slots. This is the default.

    Main hand

    hand, mainhand

    The item held when the screen opens.

    Equipment

    armor

    Armor and offhand slots only.

    Catalog

    catalog

    A paginated, read-only category from item-catalogs.yml.

    /repair <i:Select an equipped item -source:armor>
    /auction create <i:Confirm the held item -source:hand>
    /kit reward <i:Choose a reward -source:catalog -cat:combat>

    key

    minecraft:diamond_sword

    Namespaced material key; this is the default.

    material

    DIAMOND_SWORD

    /trade <p:Choose a player> <i:Select an item -source:inv -out:key>
    /inspectslot <i:Select a slot -out:slot>
    /countheld <i:Select held stack -source:hand -out:amount>

    -source:<source>

    Select from inv, hand, armor, or catalog.

    -out:<format>

    Return key, material, slot, or amount.

    -cat:<id>

    {
      "type": "item",
      "id": "combat_reward",
      "prompt_text": "Choose a combat reward",
      "source": "catalog",
      "output": "key",
      "category": "combat",
      "sound": "minecraft:block.note_block.pling",
      "sanitize": true,
      "timeout": 45
    }

    Outputs

    Flags

    Preset definition

    Item Catalogs

    Uppercase Bukkit material name.

    slot

    4

    Logical player slot 0–40. Not available for catalogs.

    amount

    16

    Verified stack size. Catalog entries return 1.

    Select a catalog category. Valid only with -source:catalog; defaults to all.

    -timeout:<seconds>

    Override the timeout; accepted range is 1–3600.

    -sound:<key>

    Play a namespaced sound when the screen opens.

    -t...

    Show the standard title overlay before opening the selector.

    Confirmation Prompt

    Use c:, confirm:, or confirmation: to place a binary decision in a prompt flow.

    /town disband <c:Disband your town?>

    Confirmation prompts have two behaviors:

    • Gate mode (default): Confirm continues without inserting an argument. Decline, closing the screen, or cancelling stops the command.

    • Value mode (-value): Confirm inserts true; Decline inserts false, and the command continues.

    Separate the question, confirm label, and cancel label with |:

    Quote text that contains a pipe. Use \" for a literal quote inside quoted text.

    Flag
    Meaning

    The mode defaults to ConfirmationUI.Default-Mode in prompt-config.yml. Invalid modes, malformed quotes, duplicate structural flags, and out-of-range timeouts reject the command instead of guessing a fallback.

    A confirmation prompt always asks the player who started the command and runs during input collection. It is useful for preventing accidental actions.

    An asks another resolved player after all local inputs have been collected but before the primary command runs. Use approval gates for consent or authorization workflows.

    Reference it with <@confirm_payment>. mode, title, confirm_text, cancel_text, value_mode, sound, and timeout are optional. prompt_text and id are required.

    prompt-config.yml controls the default presentation and GUI items:

    GUI slots must be distinct numbers from 0 through 26. Default-Mode accepts only gui, dialog, or chat. A failed configuration reload keeps the previously validated settings active.

    Closing a GUI or dialog counts as Decline in gate mode. Timeouts, disconnects, reloads, and runtime errors cancel the session without treating a programmatic close as a player decision.

    /togglepvp <c:Enable PvP here? -value>
    /town disband <c:"<red>Disband your town?</red>" | "Disband" | "Keep town">

    -mode:gui

    Use a 27-slot confirmation inventory.

    -mode:dialog

    Use Paper's native dialog UI.

    -mode:chat

    {
      "type": "confirmation",
      "id": "confirm_payment",
      "mode": "gui",
      "title": "Confirm Payment",
      "prompt_text": "Send the payment?",
      "confirm_text": "Send Funds",
      "cancel_text": "Abort",
      "value_mode": false,
      "sound": "minecraft:block.note_block.bell",
      "sanitize": true,
      "timeout": 30
    }
    ConfirmationUI:
      Default-Mode: gui
      GUI:
        Title: '&8Confirm Action'
        Confirm-Item:
          Material: LIME_CONCRETE
          Name: '&aConfirm'
          Slot: 11
        Cancel-Item:
          Material: RED_CONCRETE
          Name: '&cCancel'
          Slot: 15
        Info-Item:
          Material: PAPER
          Name: '&eInformation'
          Slot: 13
      Default-Confirm-Label: '&aConfirm'
      Default-Cancel-Label: '&cCancel'
      Sound: ''

    Labels and presentation

    Gate mode versus an approval gate

    Preset definition

    Configuration

    approval gate

    Send clickable Confirm and Cancel actions in chat.

    -value

    Return true or false instead of acting as a gate.

    -timeout:<seconds>

    Override the timeout for this prompt; accepted range is 1–3600.

    -sound:<key>

    Play a namespaced sound when the prompt opens.

    -t...

    Show the standard title overlay before opening the prompt.

    Dialog UI Prompt

    Use d: to build a native Paper dialog. Dialog prompts support text, number, choice, tab-completion, and compound layouts.

    Text

    An empty or unknown filter becomes a text field. text may be written explicitly.

    <d:Question>
    <d:text:Question>
    <d:text[256,4,300]:Question>
    <d:text[max_length=256,max_lines=4,width=300]:Question>

    Positional values are maxLength,maxLines,width. Keyed values may appear in any order. Each numeric override is clamped to 1–8192; max_lines > 1 enables multiline input.

    Number

    num, number, and numberrange are aliases.

    <d:num[0,100]:Percentage>
    <d:num[0,100,5]:Percentage>
    <d:num[0,100,5,50]:Percentage>

    The positions are min,max,step,initial. If min >= max, the effective maximum becomes min + 1. A nonpositive step becomes 1. Without an inline initial value, an overridden range starts at its midpoint; explicit initial values are clamped into the range.

    Blank options are discarded, the first remaining option is selected initially, and its display text is also the returned answer. Omitting the list uses DialogUI.Defaults.Choice.Default-Options.

    CommandPrompter requests completions for the command assembled up to this prompt. One button is shown per completion when the count is between 1 and the effective threshold. Zero completions or too many completions opens a text-input fallback. The inline threshold has a minimum of 1.

    d:tab cannot be used inside a compound dialog.

    Separate rows with top-level &&. Spaces around && are optional.

    The available row filters are:

    Filter
    Purpose
    Returned answer

    title and body are compound-only. Using either as a standalone prompt sends an error and cancels the session.

    In 3.2.0, layout rows (title and body) produce 0 answers and do not consume answer positions:

    • Multi-input dialogs produce exactly N answers (one per input row).

    • Info-only dialogs (containing only title and body rows) produce 0 answers.

    • Zero-arity dialogs and layout rows never shift {input:N} or {N} answer indices in post-commands.

    Row-processing flags such as -ds, -iv:alias, -int, and -str are validated against actual input rows. The -t flag is extracted once for the whole compound and shows one Adventure title before the native dialog; it is separate from d:title, which sets the dialog window title.

    Prompt dialogs cannot be dismissed with Escape. Client component actions—including MiniMessage open_url links in body text—leave the dialog open. Confirm, Cancel, Exit, or an answer button closes the dialog explicitly and then completes or cancels the session. Timeout, /cmdp cancel, reload, disconnect, and other server-side teardown can also close it; opening a link does not reset Prompt-Timeout.

    With the default < > prompt delimiters, escape the nested MiniMessage delimiters so they do not terminate the outer prompt tag:

    The backslashes are removed before MiniMessage renders the body. Another option is to configure non-angle prompt delimiters, such as {.*?}, so ordinary MiniMessage <click>...</click> tags do not conflict.

    See .

    Presets

    Presets are reusable prompt, post-command, approval-gate, and conditional post-command definitions stored in plugins/CommandPrompterPaper/presets.json.

    The ID is case-sensitive and stops at the first space. Typing <@ in chat suggests configured preset IDs via tab completion. Inline flags appended inside a preset reference are ignored; configure behavior in JSON. Preset sanitize settings are honored ("sanitize": false preserves formatting and special characters in input).

    Multi-input dialog presets produce N separate answers (one for each input row), while zero-input dialog presets produce 0 answers without consuming answer slots.

    The post-command's JSON execution_policy decides whether it runs on completion or cancellation. execute_as

    <d:choice[set,add,remove]:Action>
    <d:tab:Argument>
    <d:tab[8]:Argument>
    <d:title:Portal Request && d:body[plain,width=300]:Review the requirements. && d:choice[approve,deny]:Action && d:text[512,6,300]:Reason>

    title

    Sets the native dialog window title. The first title row wins.

    None (0 answers)

    body

    Adds a plain text body element with automatic width.

    <d:title:Portal Request && d:body[plain,width=300]:\<click:open_url:"https://example.com"\>Portal Docs\</click\> && d:text:Notes>

    Choice

    Tab completion

    Compound layouts

    Answer arity

    Dialog lifecycle

    Dialog UI settings
    and
    delay_ticks
    also come from the preset; inline marker/delay hints do not override them.

    Conditional post-commands use the same <!@id> reference. Their JSON condition selects if_true or if_false after the configured lifecycle event.

    An approval gate pauses after input collection and asks the target resolved by its trusted JSON definition. Decline or timeout prevents the primary command from running. See .

    Unknown prompt, post-command, conditional, or gate IDs abort interception and show a configuration error. Literal unknown tags are not passed through to the underlying command.

    Run /cmdp reload after editing presets.json. See for every field and full examples.

    /command <@my_prompt>
    /command <@my_prompt> <!@my_post_command>

    Prompt preset

    Post-command preset

    None (0 answers)

    body[300], body[plain,300], or body[plain,width=300]

    Adds wrapped text with width clamped to 1–1024 pixels.

    None (0 answers)

    body[item]

    Treats the display value as a Bukkit material and shows one item. Invalid materials fall back to Paper.

    None (0 answers)

    text[...]

    Adds a text input.

    Entered text

    choice[...]

    Adds a dropdown.

    Selected option

    num[...]

    Adds a number range.

    Selected number

    Approval-gate preset

    Command Flows
    Presets Configuration
    /trade <p:Choose a player> <i:Choose an item> <!gate:@trade_confirm>

    Optional Integrations

    CommandPrompter has no required plugin dependencies. When a supported plugin is present, its hook is loaded automatically.

    Plugin
    Integration

    CarbonChat

    Captures active Chat prompt answers through CarbonChat's event bus instead of the Bukkit chat listener.

    PlaceholderAPI

    Filter syntax is documented on . Multiple filters compose (intersect) using an anchored longest-match parser (e.g. r10s selects players within 10 blocks AND excludes self), so short keys like w never shadow longer keys like wgr. If an optional filter plugin is absent, its filter is not registered and unrecognized filter tokens are skipped.

    Supported vanish integrations (SuperVanish, PremiumVanish, VanishNoPacket) enforce vanish checks at the head-cache boundary: vanished players are never added to the cache and are filtered out across all views.

    When PlaceholderAPI is installed, placeholders expand in all player-visible presentation fields across every prompt type:

    • Chat: Prompt text, cancel message, and hover message.

    • Anvil: Window title, prompt text, and button text / hover lore.

    • Sign: Prompt text and all default lines.

    • Player UI: Prompt text and button text / hover lore.

    Semantic fields (such as preset IDs, tag keys, validator aliases, numeric constraints, action return values, and player-submitted answers) are never expanded.

    Dialog: Dialog title, body contents, row labels, and button labels / tooltips.

  • Title Displays: Main and subtitle text from -t flags and preset title_display.

  • Compound Dialogs: Display text of every sub-tag recursively.

  • Expands placeholders in inline prompt display text, localized messages, JavaScript validators, and preset post-commands where a player context is available.

    LuckPerms

    Adds lpo and lpg<group>; Player UI filters.

    Towny

    Adds tt and tn Player UI filters.

    HuskTowns

    Adds the ht Player UI filter.

    WorldGuard

    Adds wgr, wgrm<region>;, and wgro<region>; Player UI filters.

    SuperVanish

    Excludes vanished players from the normal Player UI head cache and updates the cache when visibility changes.

    PremiumVanish

    Uses the SuperVanish-compatible integration.

    VanishNoPacket

    Excludes vanished players from the normal Player UI head cache and tracks status changes.

    PlaceholderAPI

    Player UI Prompt

    Post Command

    Post-command tags dispatch additional commands after a prompt flow completes or is cancelled. A post-command-only string does not start a session; at least one prompt must be present.

    Inline syntax

    Form
    Meaning

    <!command>

    Run after successful completion.

    <!!command>

    @console and @player are whitespace-delimited tokens and may appear anywhere in the inline command body.

    Inline answer references are zero-based:

    An out-of-range inline {N} reference fails that post-action unless it uses a default="..." transformer. Answer substitutions are escaped and inserted as one command token.

    An inline command with no executor marker inherits the main command's dispatch context:

    • A normal player command runs it as that player.

    • Console Delegate runs it as console.

    • Player Delegate runs it as the target player and inherits the permission attachment.

    Explicit @player or @console overrides that inheritance. In particular, explicit @player does not carry a Player Delegate permission attachment.

    When a post-command resolves to execute as console (via explicit @console, a preset with execute_as: "console", or inherited console delegation), it is permitted only when:

    • The session originated from /consoledelegate, OR

    • The player is an operator (OP), OR

    • The player holds promptpaper.pcm.console, promptpaper.admin, or promptpaper.consoledelegate.

    If none of these conditions are met, the post-command is dropped with a warning logged to the server console.

    Answer indexing follows the effective answers collected during the session:

    • Zero-arity prompts (such as info-only dialogs with no input rows or layout-only title/body rows) contribute 0 answers and never shift answer indices.

    • Multi-input dialogs contribute exactly N answers (one per input field).

    • Inline post-command placeholders remain zero-based ({0}, {1}

    Reference a definition in presets.json with <!@id>. The preset's execution_policy, execute_as, and delay_ticks are authoritative. Parser hints such as <!!@id> or <!:40@id> do not override the preset.

    Preset placeholders are one-based:

    • {input} and {input:1}: first collected answer

    • {input:N}: Nth collected answer

    • {0}, {1}

    Append one transformer to an answer placeholder, such as {input:1:upper}, {0:trim}, or {1:math(*1.5)}. Out-of-range references without a default="..." transformer fail the action. Duplicate preset post-command references within the same lifecycle event are deduplicated and executed at most once.

    <!@id> can also reference a conditional post-command from the conditional_post_commands array. Its condition selects a trusted if_true or if_false action. See for approval gates, conditions, transformers, and -breakIf.

    <!!command> receives any answers collected before cancellation. A preset runs only when its configured execution_policy matches the actual session result, even if the reference used the opposite marker.

    See for the full JSON format.

    , ...).
  • Preset post-command placeholders remain one-based ({input}, {input:1}, {input:N}).

  • , ...: zero-based aliases
  • {player}: the prompting/target player's name, even when the command executes as console

  • %...%: PlaceholderAPI values when PlaceholderAPI is installed

  • Run after cancellation.

    <!:100 command>

    Run after completion with a 100-tick delay.

    <!!:20 command>

    Run after cancellation with a 20-tick delay.

    <!command @console>

    Force console execution.

    <!command @player>

    Force player execution.

    Executor inheritance and console gating

    Console execution gating (3.2.0)

    Answer arity guarantee (3.2.0)

    Preset post-commands

    Cancellation

    Command Flows
    Presets Configuration
    /mute <Player?> <Reason?> <!broadcast {0} was muted: {1}>
    {
      "id": "audit",
      "command": "broadcast {player} selected {input:1}",
      "execution_policy": "on_complete",
      "execute_as": "console",
      "delay_ticks": 20
    }

    Input Validation

    Validation rejects an answer, sends the configured error message, and reopens the same prompt. Apply a configured validator with the whitespace-delimited -iv:<alias> flag. Aliases are case-sensitive and must contain only word characters (letters, digits, or underscore); a hyphenated alias does not parse as one validator flag.

    Configured validators

    Each entry under Input-Validation has an Alias and Err-Message and may enable one or more checks:

    Key
    Behavior

    When an entry enables multiple checks, all of them must pass. Referencing an unknown validator alias aborts session start (the command is not executed), logs a severe fail-fast error to the server console, and sends command.error.missing_validator to the player ("Configuration error: An unknown input validator is referenced. See server console for details.").

    JavaScript expressions can reference:

    • %prompt_input%, replaced with the submitted answer

    • BukkitServer

    • BukkitPlayer

    • -int accepts only values handled by Java Integer.parseInt: signed 32-bit integers.

    • -str requires a nonblank answer.

    For compound dialogs, block-level validators and type flags are checked against every row. Do not apply them to a compound containing title or body rows because layout rows submit empty answers.

    PlaceholderAPI placeholders when that integration is installed

    Regex

    Java regular expression matched against the entire input.

    Online-Player

    Uses Bukkit's online-player name lookup. An exact name matches, but a partial name may also resolve to the closest online player.

    JS-Expression

    Nashorn JavaScript expression that must evaluate to Boolean true.

    JS-Expression runs as trusted, unsandboxed server-side Nashorn code with Java interoperability and Bukkit objects available. Only server administrators should edit it. In 3.1.1, %prompt_input% is inserted into the JavaScript source as raw, unescaped text; do not use that placeholder with untrusted player input. Prefer Regex or Online-Player validation until the runtime binds input as data instead of source code.

    Built-in flags

    Input-Validation:
      Integer-Sample:
        Alias: is
        Regex: '^\d+$'
        Err-Message: '&cEnter an integer.'
      Online-Player:
        Alias: online
        Online-Player: true
        Err-Message: '&cThat player is not online.'
      Minimum-Level:
        Alias: level10
        JS-Expression: 'BukkitPlayer.getLevel() >= 10'
        Err-Message: '&cYou must be level 10.'
    /example <Count -int> <Player -iv:online>

    Permission Attachment

    Permission attachments temporarily grant a target player a named set of permissions while Player Delegate dispatches a command.

    Permission-Attachment:
      ticks: 0
      Permissions:
        GAMEMODE:
          - bukkit.command.gamemode
          - essentials.gamemode.survival
          - essentials.gamemode.creative

    Use the group name as the delegate's second argument:

    /playerdelegate CyR1en GAMEMODE gamemode <Which gamemode?> %target_player%

    CommandPrompter captures the configured permission list for the delegated main command, unqualified inline post-commands that inherit the delegate context (on completion or cancellation), and direct no-prompt dispatch. It attaches the permissions immediately before each applicable player dispatch and schedules removal after ticks when that value is positive (Permission-Attachment.ticks defaults to 0 in 3.2.0). 0 or a negative value removes the attachment immediately after dispatch. When command dispatch fails (returns false), throws an error, or removal-scheduling fails, the attachment is removed immediately.

    Delayed inline post-commands that inherit a Player Delegate context verify that the named group still exists and has the same permissions before attaching it. If the group changed, the delayed command is skipped. An explicitly marked @player post-command does not inherit the attachment.

    Preset post-commands never inherit the Player Delegate attachment, including presets configured with execute_as: "player"; their executor is authoritative but their dispatch context is independent.

    The target can use attached permissions during the configured retention window, not only inside the delegated command call. Keep ticks as low as practical and never grant broad administrative permissions.

    Command Flows

    CommandPrompter 3.3.0 executes a prompted command as a staged flow:

    1. Collect local prompt answers.

    2. Evaluate any pre-dispatch approval gates.

    3. Dispatch the assembled primary command once.

    4. Run completion or cancellation post-actions in source order.

    If a gate is denied, times out, or cannot resolve safely, the primary command does not run. Delayed post-actions are in memory only and are dropped when the plugin or server shuts down.

    An approval gate asks a resolved second player for consent after local answers have been collected. Define the trusted target, message, and optional denial action in presets.json:

    Reference the gate after the prompts that produce its target:

    target and message use zero-based answer references ({0}, {1}, ...) plus {player} for the initiator. The target must resolve to one online player by exact name or UUID. Approval is presented in chat with single-use Accept and Decline actions bound to that target.

    Field
    Values
    Notes

    Only the canonical <!gate:@id> form is accepted. Inline target, message, delay, executor, and denial-command forms are rejected so a player cannot author a privileged gate from a command string. A target disconnect acts as denial and may run on_deny; an initiator disconnect discards the flow without running on_deny.

    Conditional post-commands choose a trusted action branch after completion or cancellation. Define them in conditional_post_commands and reference them with the normal post-command preset form <!@id>:

    At least one of if_true or if_false is required. A missing branch is a no-op when that result is selected. Branch actions accept command, execute_as, and delay_ticks from 0 through 72000 ticks.

    Conditions support:

    Kind
    Operators

    Answers use zero-based references. Quoted string literals support \" and \\. Trusted preset conditions may also use bounded PlaceholderAPI references such as %vault_eco_balance%; inline -breakIf conditions may not.

    Malformed expressions, missing answer references, missing PlaceholderAPI values, or exceeded evaluation bounds fail closed instead of selecting a branch by default.

    Post-command and trusted action templates can transform one answer during substitution:

    Transformer
    Example
    Result for sample input

    Preset aliases remain available: {input} and {input:1} refer to the first answer, so {input:1:upper} is equivalent to {0:upper}. {player} inserts the initiator's name. Transformers are single-pass and cannot be chained.

    Math uses bounded decimal arithmetic: at most 8 operations, 64 characters in the expression, 4 decimal places, and an absolute result no larger than 10^12. Results use plain decimal notation with at least two decimal places. Invalid numeric input or exceeded bounds fails the action. Division by zero in a normal post-action produces 0 and records a diagnostic.

    PlaceholderAPI expansions are supported only in trusted preset actions, are length-bounded, and are inserted as data. Inline post-actions do not expand PlaceholderAPI values.

    Attach -breakIf:<condition> to a prompt to stop the flow immediately after that answer when the condition is true:

    The candidate answer is available at its normal zero-based position, alongside answers already collected. A true result cancels manually, prevents primary dispatch, and runs cancellation post-actions. A false result continues to the next prompt. An invalid or unresolvable condition cancels with an error.

    -breakIf is intended for answer-only checks. PlaceholderAPI references are rejected in inline conditions; use a conditional post-command for trusted PAPI logic.

    Every flow captures an immutable snapshot of its referenced presets. Reload validates presets.json, item-catalogs.yml, and configuration before publishing them together. If any candidate fails, the previous validated state remains active; partially parsed definitions are never served.

    {
      "prompts": [],
      "post_commands": [],
      "approval_gates": [
        {
          "id": "trade_confirm",
          "target": "{0}",
          "message": "{player} wants to trade with you. Accept?",
          "timeout": 30,
          "self_approval_policy": "auto_approve",
          "on_deny": {
            "command": "tell {player} The trade request was declined.",
            "execute_as": "player",
            "delay_ticks": 0
          }
        }
      ],
      "conditional_post_commands": []
    }
    /trade <p:Choose a player> <i:Choose an item> <!gate:@trade_confirm>

    id

    ^[a-z0-9_.-]{1,64}$

    IDs are lowercase and unique across every preset kind.

    target

    Template

    {
      "id": "large_payment_audit",
      "condition": "{1} >= 500",
      "execution_policy": "on_complete",
      "if_true": {
        "command": "broadcast {player} sent a large payment of {1}",
        "execute_as": "console",
        "delay_ticks": 0
      },
      "if_false": {
        "command": "tell {player} Payment recorded.",
        "execute_as": "player",
        "delay_ticks": 0
      }
    }
    /pay <p:Recipient> <d:num[1,10000]:Amount> <!@large_payment_audit>

    Numeric

    ==, !=, <, <=, >, >=

    String

    equals, contains, startsWith, endsWith

    Boolean

    "condition": "{0} equals \"confirm\" && %player_level% >= 10"

    upper

    {0:upper}

    SWORD from sword

    lower

    {0:lower}

    /report <p:Player> <Reason -breakIf:{1} equals "skip"> <!!tell {player} Report cancelled>

    Approval gates

    A local asks the initiator during input collection. An approval gate asks the configured target immediately before primary dispatch.

    Conditional post-commands

    Post-action transformers

    Early termination with -breakIf

    Reload and snapshot behavior

    Required player name/UUID expression.

    message

    Template

    Required text shown to the target.

    timeout

    1–3600 seconds

    Defaults to 30.

    self_approval_policy

    auto_approve, require_confirm

    Defaults to auto_approve.

    on_deny

    Trusted action

    Optional; delay_ticks must be 0.

    &&, `

    sword from SWORD

    capitalize

    {0:capitalize}

    Sword from sWORD

    trim

    {0:trim}

    Removes leading/trailing whitespace.

    stripcolor

    {0:stripcolor}

    Removes legacy color codes.

    default="text"

    {0:default="unknown"}

    Uses the default for a blank or missing value.

    math(...)

    {1:math(*1.5)}

    30.00 from 20.

    round

    {1:round}

    Rounds to a whole number.

    Confirmation Prompt

    Console Delegate

    Console Delegate lets the server console ask one player for input and dispatch the completed command as console.

    /consoledelegate <target> <command...>
    /cd <target> <command...>
    • target accepts a player name or a single-target Minecraft selector such as @p. Multi-target selectors such as @a are rejected by the command's singular player argument.

    • command... is a greedy command string and may start with /.

    • %target_player% is replaced with the target player's name.

    • The sender must be the console and have promptpaper.consoledelegate.

    When Enable-Permission is enabled and the delegated command contains prompt tags, the target player must also have promptpaper.use. A rejected prompt flow is not dispatched literally. This target-side gate does not block a direct delegated string with no prompt tags.

    If CyR1en answers creative, console dispatches:

    If the delegated string contains no prompt tags, it is dispatched immediately as console. An unresolved preset or another rejected tag form is not dispatched literally.

    An inline post-command without an executor marker inherits the main command's console context:

    Use @player to force an inline post-command to run as the target player. Use @console to be explicit. Preset post-commands do not inherit: their execute_as property is authoritative.

    Example

    Post-commands

    Console Delegate gives player-supplied answers to a console command. Keep the command template fixed, validate untrusted input, and grant access only to trusted console automation.

    /consoledelegate CyR1en gamemode <What gamemode?> %target_player%
    gamemode creative CyR1en
    /cd CyR1en gamemode <Gamemode?> %target_player% <!broadcast %target_player% selected {0}>

    Player Delegate

    Player Delegate lets console initiate prompts for one target player, then dispatches the completed command as that player with a temporary permission group.

    /playerdelegate <target> <permission-key> <command...>
    /pd <target> <permission-key> <command...>
    • target accepts a player name or a single-target selector such as @p. Multi-target selectors such as @a are rejected by the command's singular player argument.

    • permission-key must match a group under Permission-Attachment.Permissions. Tab completion suggests only actually configured permission group keys.

    • %target_player% is replaced with each target's name.

    • The sender must be console and have promptpaper.playerdelegate.

    When Enable-Permission is enabled and the delegated command contains prompt tags, the target player must also have promptpaper.use. The temporary attachment is applied only at final dispatch, so it cannot supply this initial gate. This target-side check does not block a direct delegated string with no prompt tags.

    The configured permissions are attached immediately before dispatch and removed after Permission-Attachment.ticks (defaults to 0 in 3.2.0). If command dispatch fails or throws, the attachment is removed immediately. An unknown or empty permission group is rejected.

    If the delegated string contains no prompt tags, it is dispatched immediately as the target player with the configured attachment. An unresolved preset or another rejected tag form is not dispatched literally.

    Unqualified inline post-commands inherit the player execution context and the same permission-attachment behavior. An explicit @player forces player execution but does not inherit the attachment. A preset post-command follows its own execute_as setting and never inherits the delegate attachment, even when execute_as is player.

    See for configuration and security guidance.

    /playerdelegate CyR1en GAMEMODE gamemode <Which gamemode?> %target_player%
    Permission Attachment

    Custom Screens

    CommandPrompter 3.3.0 introduces a public service API for third-party plugins to provide prompt screens. A registered key such as ecoitem turns <ecoitem:Choose a weapon> into a normal CommandPrompter step whose answer comes from your InputScreen.

    The integration uses three public types from prompt-ui-api:

    • CommandPrompterAPI registers and unregisters providers.

    • PromptScreenFactory creates one un-opened screen per prompt step.

    • ScreenContext supplies the key, display text, custom flags, and sanitation mode.

    Use the same API version as the CommandPrompter plugin installed on the server. The custom-screen service starts in 3.3.0.

    CommandPrompter and its API are built for Java 25.

    For plugin.yml:

    Use softdepend instead when the integration is optional.

    For paper-plugin.yml:

    The server dependency ensures that CommandPrompter has published its Bukkit service before your onEnable() runs.

    Explicit unregistration is safe but optional on ordinary plugin disable: CommandPrompter listens for provider disable, removes every key owned by that plugin, cancels its active prompt sessions, and attempts to close inventory UIs.

    Registration keys:

    • Must match ^[a-z][a-z0-9_]{0,31}$.

    • Must be lowercase when registered; command tag lookup is case-insensitive.

    • Are globally unique while registered.

    • Cannot collide with screen-mappings

    An invalid or duplicate key throws IllegalArgumentException. Registration while either plugin is disabled or CommandPrompter is shutting down throws IllegalStateException.

    CommandPrompter calls a screen in this order:

    1. PromptScreenFactory.createScreen(player, context)

    2. screen.onResult(callback)

    3. screen.onOpenFailure(callback)

    This example displays one material and returns its namespaced key:

    Return ScreenResult.answer(value) for a successful answer. Common cancellation factories are ScreenResult.guiExit(), manualCancel(), timeout(), and error(). A programmatic close() must close resources without delivering a second result.

    CommandPrompter reschedules provider results onto the player's entity scheduler, discards stale callbacks, and enforces an internal exactly-once guard. Providers should still guard their own UI events, unregister listeners, and deliver no more than one result.

    A provider tag may add arbitrary trailing flags:

    The factory receives:

    Method
    Result

    Custom flags must be trailing tokens. Names start with a letter, contain only letters, digits, or underscores, and are at most 32 characters. Values are at most 512 characters, and one tag may contain at most 16 flags with at most 1024 total value characters. Duplicate flags and malformed quotes fail closed.

    • createScreen, open, and normal close calls run on the target player's entity scheduler. Return promptly and never perform blocking database, file, or network work there.

    • Return a new, non-null, unopened screen from the factory; keep factory work short.

    • A provider may deliver its result from any thread. CommandPrompter hops back to the entity scheduler and re-verifies the active session before accepting it.

    Unknown or unregistered tag keys abort interception and log an administrative diagnostic. They never fall back to Chat. The same is true if a provider unregisters between command authoring and execution.

    Problem
    Check
    in
    prompt-config.yml
    .
  • Cannot use built-in keys: the empty Chat key, a, anvil, s, sign, p, player, d, dialog, c, confirm, confirmation, i, item, or the @ preset namespace.

  • screen.open()
  • One result callback, or a later programmatic close()

  • context.flag("rarity")

    Optional case-insensitive lookup.

    context.hasFlag("glow")

    Whether a flag exists.

    context.booleanFlag("glow")

    true when its value parses as true; a bare flag has value true.

    context.flagOrDefault("rarity", "common")

    Value or a fallback.

    context.sanitize()

    false when the standard -ds flag disabled answer sanitation.

    Exceptions from the factory, open(), or a result path cancel only that session with an error.

  • When a provider disables, CommandPrompter does not invoke the provider's InputScreen.close() because its classes may be unloading. It makes a best-effort platform inventory close and cancels the session instead.

  • Providers remain responsible for non-inventory resources such as protocol screens, dialogs, database subscriptions, or external GUI state during their own disable path.

  • Prompt aborts after open

    Ensure open() returns promptly, callbacks are single-shot, and initialization failures use onOpenFailure.

    UI remains after provider disable

    Close non-inventory/protocol resources in the provider's own disable cleanup; host cleanup is best-effort for Bukkit inventories only.

    context.key()

    Canonical lowercase key.

    context.displayText()

    Display text with standard and custom flags removed.

    context.flags()

    API service is null

    Confirm the dependency declaration loads CommandPrompter first and both plugins are enabled.

    NoClassDefFoundError or class-cast failures

    Remove shaded/relocated API classes and use compileOnly/provided.

    Key rejected

    Add the API dependency

    Gradle Kotlin DSL

    Gradle Groovy DSL

    Maven

    Use compileOnly/provided. Do not shade or relocate dev.cyr1en.promptui.*; CommandPrompter supplies those classes at runtime. The custom-screen API requires CommandPrompter and prompt-ui-api 3.3.0 or newer; the released 3.2.x API does not contain this service.

    Declare the plugin dependency

    Obtain the service and register a key

    Key rules

    Implement InputScreen

    Read display text and custom flags

    Threading and lifecycle contract

    Failure behavior

    Immutable custom flag map.

    Use the lowercase grammar and check built-in, configured, and other provider keys.

    val commandPrompterVersion = "3.3.0"
    
    repositories {
        mavenCentral()
        maven("https://repo.papermc.io/repository/maven-public/")
        maven("https://repo.cyr1en.dev/snapshots")
    }
    
    dependencies {
        compileOnly("io.papermc.paper:paper-api:26.1.2.build.74-stable")
        compileOnly("dev.cyr1en:prompt-ui-api:$commandPrompterVersion")
    }
    repositories {
        mavenCentral()
        maven 'https://repo.papermc.io/repository/maven-public/'
        maven 'https://repo.cyr1en.dev/snapshots'
    }
    
    dependencies {
        compileOnly 'io.papermc.paper:paper-api:26.1.2.build.74-stable'
        compileOnly 'dev.cyr1en:prompt-ui-api:3.3.0'
    }
    <repositories>
      <repository>
        <id>cyr1en-snapshots</id>
        <url>https://repo.cyr1en.dev/snapshots</url>
      </repository>
    </repositories>
    
    <dependencies>
      <dependency>
        <groupId>dev.cyr1en</groupId>
        <artifactId>prompt-ui-api</artifactId>
        <version>3.3.0</version>
        <scope>provided</scope>
      </dependency>
    </dependencies>
    name: ExampleScreens
    version: 1.0.0
    main: com.example.screens.ExampleScreensPlugin
    api-version: '1.21'
    depend: [CommandPrompterPaper]
    name: ExampleScreens
    version: 1.0.0
    main: com.example.screens.ExampleScreensPlugin
    api-version: '1.21'
    dependencies:
      server:
        CommandPrompterPaper:
          load: BEFORE
          required: true
    package com.example.screens;
    
    import dev.cyr1en.promptui.api.CommandPrompterAPI;
    import org.bukkit.plugin.java.JavaPlugin;
    
    public final class ExampleScreensPlugin extends JavaPlugin {
        private CommandPrompterAPI commandPrompter;
    
        @Override
        public void onEnable() {
            var registration = getServer()
                    .getServicesManager()
                    .getRegistration(CommandPrompterAPI.class);
    
            if (registration == null) {
                getLogger().warning("CommandPrompterAPI is unavailable; custom screens were not registered.");
                return;
            }
    
            commandPrompter = registration.getProvider();
            commandPrompter.registerScreen(
                    this,
                    "material_picker",
                    (player, context) -> new MaterialPickerScreen(this, player, context));
        }
    
        @Override
        public void onDisable() {
            if (commandPrompter != null) {
                commandPrompter.unregisterScreens(this);
            }
        }
    }
    package com.example.screens;
    
    import dev.cyr1en.promptui.InputScreen;
    import dev.cyr1en.promptui.ScreenResult;
    import dev.cyr1en.promptui.api.ScreenContext;
    import java.util.concurrent.atomic.AtomicBoolean;
    import java.util.function.Consumer;
    import net.kyori.adventure.text.minimessage.MiniMessage;
    import org.bukkit.Bukkit;
    import org.bukkit.Material;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.HandlerList;
    import org.bukkit.event.Listener;
    import org.bukkit.event.inventory.InventoryClickEvent;
    import org.bukkit.event.inventory.InventoryCloseEvent;
    import org.bukkit.event.inventory.InventoryDragEvent;
    import org.bukkit.inventory.Inventory;
    import org.bukkit.inventory.ItemStack;
    import org.bukkit.plugin.Plugin;
    
    public final class MaterialPickerScreen implements InputScreen, Listener {
        private final Plugin plugin;
        private final Player player;
        private final ScreenContext context;
        private final AtomicBoolean completed = new AtomicBoolean();
    
        private Consumer<ScreenResult> resultCallback;
        private Consumer<Throwable> openFailureCallback;
        private Inventory inventory;
        private boolean open;
    
        public MaterialPickerScreen(Plugin plugin, Player player, ScreenContext context) {
            this.plugin = plugin;
            this.player = player;
            this.context = context;
        }
    
        @Override
        public void onResult(Consumer<ScreenResult> callback) {
            resultCallback = callback;
        }
    
        @Override
        public void onOpenFailure(Consumer<Throwable> callback) {
            openFailureCallback = callback;
        }
    
        @Override
        public void open() {
            try {
                var title = MiniMessage.miniMessage().deserialize(context.displayText());
                inventory = Bukkit.createInventory(null, 9, title);
                inventory.setItem(4, new ItemStack(Material.DIAMOND_SWORD));
    
                Bukkit.getPluginManager().registerEvents(this, plugin);
                open = true;
                player.openInventory(inventory);
            } catch (Throwable error) {
                open = false;
                HandlerList.unregisterAll(this);
                if (openFailureCallback != null) {
                    openFailureCallback.accept(error);
                }
            }
        }
    
        @Override
        public void close() {
            if (!open) return;
            open = false;
            HandlerList.unregisterAll(this);
            if (player.getOpenInventory().getTopInventory().equals(inventory)) {
                player.closeInventory();
            }
        }
    
        @Override
        public boolean isOpen() {
            return open;
        }
    
        @EventHandler
        public void onClick(InventoryClickEvent event) {
            if (!open || !event.getWhoClicked().equals(player)) return;
            if (!event.getView().getTopInventory().equals(inventory)) return;
    
            event.setCancelled(true);
            if (event.getClickedInventory() == null
                    || !event.getClickedInventory().equals(inventory)
                    || event.getSlot() != 4) {
                return;
            }
    
            complete(ScreenResult.answer("minecraft:diamond_sword"), true);
        }
    
        @EventHandler
        public void onDrag(InventoryDragEvent event) {
            if (!open || !event.getWhoClicked().equals(player)) return;
            if (!event.getView().getTopInventory().equals(inventory)) return;
            event.setCancelled(true);
        }
    
        @EventHandler
        public void onClose(InventoryCloseEvent event) {
            if (!open || !event.getPlayer().equals(player)) return;
            if (!event.getView().getTopInventory().equals(inventory)) return;
            complete(ScreenResult.guiExit(), false);
        }
    
        private void complete(ScreenResult result, boolean closeInventory) {
            if (!completed.compareAndSet(false, true)) return;
    
            open = false;
            HandlerList.unregisterAll(this);
            if (closeInventory && player.getOpenInventory().getTopInventory().equals(inventory)) {
                player.closeInventory();
            }
    
            if (resultCallback != null) {
                resultCallback.accept(result);
            }
        }
    }
    /reward <material_picker:Choose a weapon -glow -rarity:legendary -description:"Event reward">
    https://cdn.discordapp.com/attachments/936346802951716880/1184752613003108392/2023-12-13_23-51-00.mp4?ex=658d1dda&hm=b4bcf5e70a5ec0109536bbcf05f97f9512752b3bf79d2fcc14dd6ba131347731&is=657aa8dacdn.discordapp.com