> 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/item-selector-prompt.md).

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

Choose the source with `-source:<source>`:

```
/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>
```

## Outputs

The selected item contributes one answer token.

| Output     | Example                   | Notes                                                 |
| ---------- | ------------------------- | ----------------------------------------------------- |
| `key`      | `minecraft:diamond_sword` | Namespaced material key; this is the default.         |
| `material` | `DIAMOND_SWORD`           | Uppercase Bukkit material name.                       |
| `slot`     | `4`                       | Logical player slot 0–40. Not available for catalogs. |
| `amount`   | `16`                      | Verified stack size. Catalog entries return `1`.      |

Choose the output with `-out:<format>`:

```
/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>
```

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.

## Flags

| Flag                 | Meaning                                                                          |
| -------------------- | -------------------------------------------------------------------------------- |
| `-source:<source>`   | Select from `inv`, `hand`, `armor`, or `catalog`.                                |
| `-out:<format>`      | Return `key`, `material`, `slot`, or `amount`.                                   |
| `-cat:<id>`          | 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.                     |

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

## Preset definition

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

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

See [Item Catalogs](/commandprompter/configuration/item-catalogs.md) to define catalog categories and reload behavior.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
