> For the complete documentation index, see [llms.txt](https://cyr1en.gitbook.io/commandprompter/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cyr1en.gitbook.io/commandprompter/prompts/confirmation-prompt.md).

# 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.

```
/togglepvp <c:Enable PvP here? -value>
```

## Labels and presentation

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

```
/town disband <c:"<red>Disband your town?</red>" | "Disband" | "Keep town">
```

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

| Flag                 | Meaning                                                         |
| -------------------- | --------------------------------------------------------------- |
| `-mode:gui`          | Use a 27-slot confirmation inventory.                           |
| `-mode:dialog`       | Use Paper's native dialog UI.                                   |
| `-mode:chat`         | 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.      |

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.

## Gate mode versus an approval gate

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

An [approval gate](/commandprompter/features/command-flows.md#approval-gates) 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.

## Preset definition

```json
{
  "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
}
```

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

## Configuration

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

```yaml
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: ''
```

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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cyr1en.gitbook.io/commandprompter/prompts/confirmation-prompt.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
