# 家具执行动作

## 交互时执行命令

```yaml
items:
  lamp:
    display_name: "Lamp"
    permission: myitems.decorative.lamp
    lore:
    - lore-decorative-item
    resource:
      material: PAPER
      generate: false
      model_path: lamp
    behaviours:
      furniture:
        light_level: 13
        solid: true
    events:
      placed_armorstand:
        interact:
          execute_commands:
            the_first_command:
              command: help
              as_console: false
```

在这个例子中，你可以看到一个家具，当玩家与其交互时会执行命令 `/help`。

当然，你也可以在[placed\_armorstand](/chinese/cha-jian-shi-yong-fang-fa/adding-content/item-properties/events.md)中添加更多的[动作](/chinese/cha-jian-shi-yong-fang-fa/adding-content/item-properties/events/actions.md)，不仅是 `execute_commands`。

## 交互时打开交易菜单

```yaml
  energy_extractor:
    display_name: display-name-energy_extractor
    permission: energy_extractor
    resource:
      material: PAPER
      generate: false
      model_path: item/energy_extractor
    behaviours:
      furniture:
        solid: true
      furniture_trade_machine:
        title: Energy Extractor
        trades_list:
          cobblestone:
            ingredients:
              slot1:
                item: COBBLESTONE
                amount: 64
            result:
              item: energy_orb
              amount: 6
          cobblestone_slab:
            ingredients:
              slot1:
                item: COBBLESTONE_SLAB
                amount: 64
            result:
              item: energy_orb
              amount: 3
```

在这个例子中，你可以看到如何将交易 GUI 附加到你的家具上。这对于创建自定义机器非常有用。


---

# 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://itemsadder.devs.beer/chinese/cha-jian-shi-yong-fang-fa/adding-content/advanced-furniture-properties/furniture-execute-actions.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.
