> For the complete documentation index, see [llms.txt](https://itemsadder.devs.beer/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://itemsadder.devs.beer/chinese/cha-jian-shi-yong-fang-fa/adding-content/item-properties/events.md).

# 事件

## 使用官方文件编辑器查看所有属性

{% content-ref url="/pages/oLImuV3Kx7ThZRNTAlJa" %}
[文件编辑器](/chinese/cha-jian-shi-yong-fang-fa/files-editor.md)
{% endcontent-ref %}

## 什么是事件？

事件描述了某事发生的时间。\
当事件被触发时，你可以让事情发生（[动作](/chinese/cha-jian-shi-yong-fang-fa/adding-content/item-properties/events/actions.md)）（播放声音、执行命令等）

### 事件列表

* block\_break
* attack
* kill
* interact.entity
* interact.left
* interact.left\_shift
* interact.right
* interact.right\_shift
* interact\_mainhand.left
* interact\_mainhand.left\_shift
* interact\_mainhand.right
* interact\_mainhand.right\_shift
* interact\_offhand.left
* interact\_offhand.left\_shift
* interact\_offhand.right
* interact\_offhand.right\_shift
* drop
* pickup
* eat
* drink
* bow\_shot
* gun\_shot
* gun\_no\_ammo
* gun\_reload
* book\_write
* book\_read
* fishing\_start
* fishing\_caught
* fishing\_failed
* fishing\_cancel
* fishing\_bite
* fishing\_in\_ground
* wear
* unwear
* held
* held\_offhand
* unheld
* unheld\_offhand
* item\_throw
* item\_hit\_ground
* item\_hit\_entity
* placed\_block.interact
* placed\_block.break
* placed\_armorstand.interact
* placed\_armorstand.break
* placed\_itemframe.interact
* placed\_itemframe.break
* holding\_item.player\_damaged\_by\_entity
* holding\_item\_offhand.player\_damaged\_by\_entity
* equipped\_armor\_item.player\_damaged\_by\_entity
* bucket\_empty
* bucket\_fill

### 示例

为什么写成 `interact (.) right`？下面是一个如何正确写入你的物品配置的小例子。

```yaml
...
events:
  interact:
    right:
      play_sound:
      ...
...
```


---

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