> 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** 相同则覆盖掉原先的数据
