# AttributeExtension

## 前言

> AttributeExtension 分有 **免费版/付费版** 付费版有一些特殊的关键词,当然大部分免费版都有,至于我为什么弄这个付费版,因为我也要吃饭嘛,**免费版不会影响插件正常使用,大部分功能都有**\
> \
> 那付费版该怎么获取? | 联系我 **QQ1508444061** | 售价 **60**\
> \
> **付费版可做到:** [**http://www.ersha-plugins.top:10271/AttributeExtension.gif**](http://www.ersha-plugins.top:10271/AttributeExtension.gif)\
> **插件更新记录:** [**https://ersha.gitbook.io/attributeextensi/geng-xin-ji-lu**](https://ersha.gitbook.io/attributeextensi/geng-xin-ji-lu)

## 属性类型

目前仅有 **DAMAGE INJURED RUNTIME NULL** 四种属性类型\
其中 **NULL** 是没有任何属性效果的类型,但作用很大,他可以用来其他其他类型的属性读取到属性值\
\
**RUNTIME** 不适用于怪物仅适用于 **玩家**\
**NULL DAMAGE INJURED** 同时适用于 **玩家&怪物**

```
例如暴击属性效果,分别为 "暴击几率,暴击伤害" 两个部分组成
那么 "暴击几率" 的属性类型就是 DAMAGE 而 "暴击伤害" 则是 NULL 类型
因为 "暴击伤害" 仅提供属性值,而 "暴击几率" 才是执行的属性
```

## 新变量

> 插件带有两个 PlaceholderAPI 变量\
> %ae\_\<r-a:属性名-属性满\[1]>% — 属性值范围随机 ("物理伤害"为最小值 & "物理伤害\[1]"为最大值) \
> %ae\_\<r-v:变量值名-变量值名>% — 变量值范围随机 (变量值为 value 关键词)

## 自带的一个特殊属性

> 这个是插件自带的一个新属性,这个属性需要配合 MythicMobs 来提高玩家爆率的属性!\
> 这个配置是插件的 config.yml 配置文件

```yaml
AttributeExtension:
  #爆率属性,需MythicMobs插件支持
  ExplodeRate:
    key: "爆率提升"
    placeholder: "exploderate"
    #这里的值是 (属性值/value) = 最后掉率的加成
    #MythicMobs 掉率 1.0 就相当于百分之100
    value: 500
    type: "NULL"
```

## 新属性扩展配置 (建议看完 属性执行效果教程 章节再来看)

> 属性配置存放于 extension 文件夹内

```yaml
#配置格式
AttributeExtension:
  #节点名,不要出现相同就可以
  test1:
    #属性名
    key: "属性名"
    #属性变量
    placeholder: "test1"
    #设置 1 则默认启动该属性,即不需要给玩家增加属性也会触发 run 效果
    #不需要自动触发设为 0 或 删除该行即可
    defaultValue: 1
    #属性类型 DAMAGE INJURED RUNTIME NULL 四个
    type: "DAMAGE"
    #属性效果具体看目录"属性执行效果教程"那一页
    run:
     - "0"
     - "1"
```

> extension/咒杀属性.yml  的配置内容,插件默认自带生成的属性示例文件

```yaml
AttributeExtension:
  #自定义
  test:
    key: "咒杀几率"
    placeholder: "test1"
    type: "DAMAGE"
    run:
      - "value chance [{attacker 咒杀几率}-{entity 咒杀抵抗}]"
      - "value damage [({entity 生命力}+5/2)+{attacker 咒杀伤害}]"
      - "chance chance,false"
      - "damage add {damage}"
      - "message attacker [&6咒杀属性触发,已对 &c{e:entity} &6造成 &c{v:damage} &6点伤害!]"
      - "message entity [&6对方触发咒杀属性,你受到了 &c{v:damage} &6点伤害!]"
  test2:
    key: "咒杀抵抗"
    placeholder: "test2"
    type: "NULL"
  test3:
    key: "咒杀伤害"
    placeholder: "test3"
    type: "NULL"
```

> extension/战士属性.yml  的配置内容,插件默认自带生成的属性示例文件

```yaml
AttributeExtension:
  test4:
    key: "战士加成"
    placeholder: "test4"
    run:
      - "value health [{attacker 战士加成}*2]"
      - "value damage [({attacker 物理防御[1]}/2)*{attacker 战士加成}/100]"
      - "cd 100"
      - "attribute 诅杀加成 entity [物理伤害: {v:damage},生命力: {v:health}] 20"
    type: "RUNTIME"
  test5:
    key: "免伤几率"
    placeholder: "test5"
    run:
      - "value chance [{entity 免伤几率}]"
      - "chance chance,false"
      - "cancelled attacker"
      - "message entity [&6触发免伤!]"
    type: "INJURED"
```

{% hint style="info" %}
现在看不懂无所谓,你看完 **属性执行效果教程部分** 就知道了!
{% 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://ersha.gitbook.io/attributeextensi/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.
