# 创建一个自定义魔咒

## 示例配置

<pre class="language-yaml"><code class="lang-yaml"># 魔咒的ID就是 .yml 文件的名称
# 例如 coin.yml 的魔咒ID就是 coin
# 你可以将魔咒的配置文件放置到 enchants 文件夹下的任意位置
# 包括放置到子文件夹里面
# _example.yml 文件不会加载
<strong>
</strong><strong>display-name: "示例魔咒" # 游戏中该魔咒的显示名称
</strong>description: "给予 &#x26;a%placeholder%%&#x26;8 额外攻击伤害" # 魔咒描述
placeholder: "%level% * 20" # 魔咒描述中使用的变量符
placeholders:
  seconds: "1 + %level%" #也支持以这种格式增加多种变量符，在描述中通过 %key% 格式使用它们，例如这里就是 %seconds%
  radius: "3 + 2 * %level%"
type: normal # 魔咒类型，魔咒类型ID见 types.yml

targets: # 魔咒可用物品类型，魔咒可用物品类型ID见 targets.yml
  - sword
conflicts: # 与该魔咒冲突的魔咒
  - sharpness
rarity: common # 魔咒品质类型，魔咒配置类型ID见 rarity.yml
max-level: 4 # 魔咒最高等级

tradeable: true # 魔咒是否可以通过村民交易获得
discoverable: true # 魔咒是否可以通过战利品箱获得
enchantable: true # 魔咒是否可以通过附魔台获得

# 魔咒的效果
# 使用 %level% 来表示魔咒等级的变量符
effects:
  - id: damage_multiplier
    args:
      multiplier: 1 + 0.2 * %level%
    triggers:
      - melee_attack

# 魔咒效果能够激活的条件
# 你仍可以使用 %level% 变量符
conditions: [ ]
</code></pre>

## 如何添加魔咒

所有的魔咒的配置文件都储存在 `plugins/EcoEnchants/enchants` 文件夹，你可以在这个文件夹添加或者删除魔咒的配置文件，同时这里有一个 `_example.yml` 的示例配置文件供你参考。


---

# 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/auxilor-plugins/ecoenchants/chuang-jian-yi-ge-zi-ding-yi-mo-zhou.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.
