# Use

**Description:**\
Runs the "use" action for the currently held custom item. If the custom item contains a command string that requires arguments, the command will substitute `#` placeholders with provided arguments before invoking the item's `ItemEvents.Command` handler.

**Command:**\
`.use`

**Behavior / logic summary:**

* Must be executed in-game (a `Player` must be available).
* Validates the player is holding a `CustomItem` of type `CustomItemType.Item`.
* Iterates `IItemData.Data` entries to find any `Command` strings that contain `#` placeholders.
* Counts the number of `#` placeholders and ensures the player supplied at least that many arguments; if not, returns an error showing required vs provided argument counts.
* Replaces each `#` with the corresponding argument (`#` are processed left-to-right).
* After substitution, the command reassigns the modified data and triggers the item


---

# Agent Instructions: 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:

```
GET https://docs.uci.ucserver.it/uncomplicatedcustomitems/api/commands/user-commands/use.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
