> For the complete documentation index, see [llms.txt](https://ersha.gitbook.io/attributeapi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ersha.gitbook.io/attributeapi/master.md).

# 开发文档

## 前提说明

| 类名                 | 描述                |
| ------------------ | ----------------- |
| ExAttributeAPI     | 插件部分方法API         |
| AttributeData      | 属性数据储存            |
| AttributeHandleAPI | 属性处理API (增加属性等方法) |

### ExAttributeAPI

| 方法                              | 描述                          |
| ------------------------------- | --------------------------- |
| getItemData(ItemStack item)     | 获取物品的 AttributeData 数据      |
| getLoreList(List\<String> list) | 获取 List 内的 AttributeData 数据 |

### AttributeData

| 方法                                     | 描述                                             |
| -------------------------------------- | ---------------------------------------------- |
| add(String source, AttributeData data) | 为当前 AttributeData 数据加上另一个 源 的 AttributeData 数据 |
| take(String source)                    | 为当前 AttributeData 数据扣除另一个 源 的 AttributeData 数据 |
| getList(String source)                 | 得到当前 AttributeData 数据内指定 源 的属性内容               |
| getList()                              | 得到当前 AttributeData 数据内所有属性内容                   |

> **source** 相同则覆盖掉原先的属性数据

### AttributeHandleAPI

| 方法                                                                         | 描述            |
| -------------------------------------------------------------------------- | ------------- |
| addAttribute(Entity entity, Class\<?> aClass, AttributeData attributeData) | 为实体增加属性       |
| deleteAttribute(Entity entity, Class\<?> aClass)                           | 删除实体指定属性来源的属性 |
| getData(Entity entity, Class\<?> aClass)                                   | 获取实体指定属性来源的数据 |

> **aClass** 相同则覆盖掉原先的数据


---

# 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://ersha.gitbook.io/attributeapi/master.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.
