# 创建一个自定义物品

## 示例配置

示例配置如下：

<pre class="language-yaml"><code class="lang-yaml"># 物品的ID就是 .yml 文件的名称
# 例如 hardened_netherite_sword.yml 的物品ID就是 hardened_netherite_sword
# 你可以将物品的配置文件放置到 items 文件夹下的任意位置
# 包括放置到子文件夹里面
# _example.yml 文件不会加载

item:
  item: iron_sword hide_attributes # 物品语句
  display-name: "&#x3C;g:#f953c6>熔炼剑&#x3C;/g:#b91d73>" # 物品的显示名称
  lore: # 物品Lore
    - "&#x26;7伤害: &#x26;c12❤"
    - "&#x26;7攻击速度: &#x26;c1.5"
    - ""
    - "&#x3C;g:#f953c6>熔炼增益&#x3C;/g:#b91d73>"
    - "&#x26;8» &#x26;#f953c6在下界造成额外 50% 的伤害"
  craftable: true # 该物品是否可以合成
  recipe: # 合成配方
    - ""
    - ecoitems:mithril 2
    - ""
    - ""
    - ecoitems:mithril 2
    - ""
    - ""
    - stick
    - ""
  recipe-give-amount: 1 # 可选，该物品合成配方合成后所给的数量
<strong>  permission: test # 可选，该物品合成配方所需要的权限
</strong>
  # 实际上物品的耐久并没有改变，我们只是更改物品耐久消耗的速率
  # 例如你在这里设置了700，而物品实际耐久是350，那么物品耐久消耗速率将会为原来的一半

  effective-durability: 1024 # 可选，设置物品耐久效率

# 物品激活效果时需要物品所在的槽位
# 支持填写 mainhand, offhand, hands, helmet, chestplate,
# leggings, boots, armor, any, 0-40的数字（以代表具体格子）,
# 或者多个槽位写在一起 "9, 10, 11, mainhand"
# 利用此选项以让这个物品变成武器、盔甲、饰品等
# 如果这个选项没有设置，则默认为 mainhand
slot: mainhand

base-damage: 12 # 可选，物品的基础伤害
base-attack-speed: 1.5 # 可选，物品的攻击速度

# 物品的效果
effects:
  - id: damage_multiplier
    args:
      multiplier: 1.5
    triggers:
      - melee_attack
<strong>
</strong><strong># 物品效果能够激活的条件
</strong>conditions:
  - id: in_world
    args:
      world: world_the_nether
</code></pre>

## 如何添加物品

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

## 如何添加配方

和物品类似，所有的配方的配置文件都储存在 `plugins/EcoItems/recipes` 文件夹，你可以在这个文件夹添加或者删除配方的配置文件，同时这里有一个 `_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/ecoitems/chuang-jian-yi-ge-zi-ding-yi-wu-pin.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.
