# 家具碰撞

### 如何使家具变得坚固？

你可以通过添加 "solid" 属性并指定一个碰撞箱（如果你想要 > 1x1x1）来使家具变得坚固。

```yaml
  table:
    display_name: display-name-table
    permission: table
    lore:
      - 'lore-decorative-item'
    resource:
      material: OAK_WOOD
      generate: false
      model_path: item/table
    behaviours:
      furniture:
        small: true
        solid: true
        entity: armor_stand
        hitbox:
          length: 1
          width: 1
          height: 1
          length_offset: 0
          width_offset: 0
          height_offset: 0
```

![](/files/-MHBUqqhFKQanZ9H8STk)

## 碰撞箱位置错误 <a href="#show-the-hitbox" id="show-the-hitbox"></a>

{% hint style="warning" %}
有时你需要设置一个补偿来修正碰撞箱位置。\
例如，你的家具大小为 2x1x1。
{% endhint %}

### 错误碰撞箱位置

![](/files/UUAjBmZ7FLexE5p9ALL5)

### 正确位置 <a href="#show-the-hitbox" id="show-the-hitbox"></a>

![](/files/IYuoUR14T22TEsdIIsMm)

我将宽度**补偿**设置为了 **0.5**.\
你也可以在必要时使用负向补偿。

```yaml
        hitbox:
          length: 1
          width: 2
          height: 1
          width_offset: 0.5
```

## 预览碰撞箱 <a href="#show-the-hitbox" id="show-the-hitbox"></a>

{% hint style="info" %}
你可以使用命令 `/iahitbox` 来查看你放置家具时的碰撞箱，这对于检测碰撞箱配置中的错误非常有用。
{% endhint %}

![](/files/FcIAPP4qr6yA0hBzitl8)

![](/files/-MbuGYzRbQmwxfWZrSt4)

![](/files/-MbuGb5aEU5OUiQYtiAN)

{% hint style="warning" %}
**碰撞箱限制**

**`item_frame` 限制(不影响 `armor_stand`)**

使用 `entity: item_frame` 的**家具**仅支持宽度和长度相同的碰撞箱。\
例如：`width: 2`, `length: 2`, `height: 1`。

\
如果你想要不同的宽度和长度，请使用 `entity: item_display` 或 `armor_stand`。
{% endhint %}


---

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