# 属性相关

## 怎么设置属性呢?

插件只提供属性方面内容 **物品Lore** 修改请另找插件，可以是 **MythicMobs** 的物品功能，也可以用 **EditLore** 插件，任何可以修改 **物品Lore** 的插件都可以，只要属性标签正确就可以让属性生效

## 属性读取格式

本插件读取格式可存在多种，可通过 [**开发API**](https://ersha.gitbook.io/attributeplus-pro/kai-fa-wen-dang) 增加更多不同的读取方式\
默认的读取方式、读取条件 ([**点击查看详细**](https://www.mcbbs.net/thread-898670-1-1.html))

## 属性内容

插件目前提供 **41** 种属性，不论是 **伤害、防御、生命、PVP/PVE类** 属性，这些属性将在服务器加载完插件后生成在 **attribute.yml** 配置内，当然你也可以通过 [**开发API**](https://ersha.gitbook.io/attributeplus-pro/kai-fa-wen-dang) 增加更多特色属性

{% hint style="info" %}
插件 3.0.9 版本开始支持用户自己编写新的属性，但你需要有一些 JavaScript 的知识。\
请查看 [**属性脚本**](https://ersha.gitbook.io/attributeplus-pro/shu-xing-jiao-ben) 教程
{% endhint %}

## 属性类型

| 类型              | 说明                    |
| --------------- | --------------------- |
| attackOrDefense | 攻击与防御类属性              |
| update          | 更新类属性，即在属性刷新时触发       |
| runtime         | 运行类属性，即每隔几秒触发一次       |
| other           | 其他类属性，没有具体的触发方式，由开发者写 |

## 属性变量

每个属性都有一个固定的变量，变量有多种显示方式，他们分别为

| 格式                  | 说明                  |
| ------------------- | ------------------- |
| %ap\_<属性变量>%        | 显示 "0 - 0" 格式的属性值   |
| %ap\_<属性变量>:min%    | 显示属性最小值             |
| %ap\_<属性变量>:max%    | 显示属性最大值             |
| %ap\_<属性变量>:random% | 显示一次从 最小值\~最大值 的随机值 |

**<属性变量>** 为 **attribute.yml** 配置内的每个节点，例如 **attack** 则为 **%ap\_attack%**

## 我能不能自己写新的属性?

可以，但目前新版插件并不支持 **AttributeExtension** 插件，所以 **普通用户是没办法自己写属性** 的，你需要**掌握 Java、Kotlin 其中一门编程语言** 或 **找其他开发者** 并借助开发文档进行 **开发/定制**。([开发文档](https://ersha.gitbook.io/attributeplus-pro/kai-fa-wen-dang))


---

# 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://ersha.gitbook.io/attributeplus-pro/shu-xing-xiang-guan.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.
