# 9.x 版本

自定义附魔配置可以在 `plugins/EcoEnchants/enchants` 文件夹中找到，每个附魔的配置是独立的，其文件名称就是附魔 **id**，其余大体仍相同。

```
display-name: "烈焰挖掘"
description: "&a%placeholder%% &8几率挖掘 3 x 3 范围的方块."
placeholder: "5 * %level%"
type: normal

targets:
  - pickaxe
conflicts:
  - drill
  - vein
rarity: legendary
max-level: 3

tradeable: true
discoverable: true
enchantable: true

effects:
  - effects:
      - id: create_explosion
        args:
          power: 0
          amount: 1
      - id: mine_radius
        args:
          radius: 1
          blacklisted_blocks: [ ]
          check_hardness: true
          disable_on_sneak: true
    args:
      chance: "5 * %level%"
      cooldown: 0.05
      send_cooldown_message: false
    triggers:
      - mine_block
conditions: [ ]
```

我们可以看出它由以下部分组成：

* **display-name**：附魔的显示名称。
* **description**: 附魔的描述，玩家可以通过 **/enchantinfo** 指令打开的菜单查询到，也可以通过开启 `plugins/EcoEnchants/config.yml` 中的 `display.descriptions.enabled` 选项，将其修改为 `true` 即可。

{% hint style="info" %}
本教程将引用一种新的描述格式，以上文的 `display.descriptions.enabled` 为例，它在配置中实际显示如下：
{% endhint %}

<figure><img src="/files/zA2DsnxD20emxRq1S43P" alt=""><figcaption></figcaption></figure>

* **placeholder**：变量符公式，可以在上一个选项中使用 `%placeholder%` 显示变量符中的内容，具体请见 **数值语法学习**。

{% hint style="info" %}
effects 和这里的变量符公式不是互通的，因此如果你错误的设置这两个选项会导致附魔实际效果和现实的效果不一致。

这里所给的示例是几率类型的技能，这往往是小白的灾难区，因为你显示给玩家的是 50% 几率中的 50 数字，而实际技能配置（effects选项中），你设置的应该是 0.5 小数。
{% endhint %}

* **type**：附魔的类型。

请打开 `plugins/EcoEnchants/types.yml` 文件，该选项与该文件有直接关联。

打开后我们可以看到如下内容：

```
types:
  - id: normal
    format: "&7"
    limit: -1
    high-level-bias: 0
```

我们可以看出各个附魔类型由以下部分组成：

* **id**：附魔类型的 **id**。
* **format**：附魔类型的颜色代码。
* **limit**：一件物品拥有该附魔类型的附魔的上限，使用 **-1** 代表无限制。
* **high-level-bias**：该附魔类型高等级生成偏差。填写 **0-1** 之间数值。

继续：

* **rarity**：附魔的品质。

请打开 `plugins/EcoEnchants/rarity.yml` 文件，该选项与该文件有直接关联。

打开后我们可以看到如下内容：

```
rarities:
  - id: common
    display-name: "普通"
    table-chance: 30
    minimum-level: 1
    villager-chance: 10.5
    loot-chance: 12
```

稀有度不仅可以显示在附魔上，它更重要功能是决定玩家能够获得这个附魔的概率。

我们可以看出各个附魔品质由以下部分组成：

* **id：**&#x9644;魔品质的 **id**。
* **display-name**：附魔品质的显示名称。
* **table-chance**：附魔台中随机到获得该附魔的概率。
* **minimum-level：**&#x9644;魔台获得此稀有度附魔的最低等级。
* **villager-chance：**&#x6751;民交易中含有此稀有度附魔的概率。
* **loot-chance：**&#x5B9D;箱中含有此稀有度附魔书的概率。

继续：

* **max-level**：该附魔的最高等级。
* **tradeable**：该附魔是否会被村民交易随机到。
* **discoverable**：该附魔是否会被宝箱随机到。
* **enchantable**：该附魔是否会被附魔台随机到。
* **effects/conditions：**&#x54;he Effect System（自定义技能系统）的内容，将在后文介绍。


---

# 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://docs.superiormc.cn/ecox-doc/yi-ban-pei-zhi-ge-shi/zi-ding-yi-fu-mo/9.x-ban-ben.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.
