> For the complete documentation index, see [llms.txt](https://trades.advancedplugins.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trades.advancedplugins.net/configuration/commands.md).

# Commands

With AdvancedTrades, your villagers can also trade commands instead of items.

Add `commands` setting under `tradeResult` section and set your commands there. Example of commands section:

```yaml
      commands: # If command reward is set, only commands will be ran when trading,  # read more at https://trades.advancedplugins.net/configuration/commands
        - 'give %player% diamond_sword 1 name:&cCommand_Sword'
```

Example of this command setting in full trade:

```yaml
    tradeResult: # Item which villager will offer in exchange of trade ingredients
      villager:
        experience: 5 # Experience gained by villager with this trade, read more at https://trades.advancedplugins.net/trades/levels
      item: # Item will not be given when traded, if command reward is set, read more at https://trades.advancedplugins.net/configuration/commands
        type: 'DIAMOND_SWORD'
        amount: 1
        name: '&cCommand Sword'
        lore:
          - '&dExclusive from &dVillagers'
        enchantments:
          - 'Sharpness:5'
          - 'Unbreaking:2'
      commands: # If command reward is set, only commands will be ran when trading,  # read more at https://trades.advancedplugins.net/configuration/commands
        - 'give %player% diamond_sword 1 name:&cCommand_Sword'

```


---

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

```
GET https://trades.advancedplugins.net/configuration/commands.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.
