# 创建一个自定义技能

## 示例配置

示例配置如下：

```yaml
# 能力的ID就是 .yml 文件的名称
# 例如 mining.yml 的能力ID就是 mining
# 你可以将能力的配置文件放置到 effects 文件夹下的任意位置
# 包括放置到子文件夹里面
# _example.yml 文件不会加载

name: 挖掘 # 显示给玩家的技能名称
description: 通过挖掘方块赚得技能经验值 # 技能描述

# 技能GUI内的设置
gui:
  enabled: true # 可选，该属性是否在GUI内显示

  icon: player_head texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZmIxYzI2OGVmZWM4ZDdkODhhMWNiODhjMmJmYTA5N2ZhNTcwMzc5NDIyOTlmN2QyMDIxNTlmYzkzY2QzMDM2ZCJ9fX0=

  lore:
    - "&f增加属性:"
    - "&8» &r%ecoskills_defense_name%"
    - "&8» &r%ecoskills_ferocity_name%"
    - "&f"
    - "&f解锁能力:"
    - "&8» &r&6%ecoskills_versatile_tools_name% %ecoskills_versatile_tools_numeral%"
    - "   %ecoskills_versatile_tools_description%"
    - "&8» &r&6%ecoskills_spelunking_name% %ecoskills_spelunking_numeral%"
    - "   %ecoskills_spelunking_description%"
    - "&8» &r&6%ecoskills_dynamic_mining_name% %ecoskills_dynamic_mining_numeral%"
    - "   %ecoskills_dynamic_mining_description%"

  position:
    row: 3
    column: 3

hide-before-level-1: true # 如果该技能等级是0的情况下，是否隐藏该技能


# # 有两种指定各个等级需要的经验值的方案:
#  1. 一个没有等级上限的等级计算公式
#  2. 一个指定各个等级所需经验值的列表

# 如果是第一种方案，需要使用以下两个选项
# xp-formula: (2 ^ %level%) * 25
# 这个选项代表等级计算公式，其中 %level% 代表对应的等级
# max-level: 10 
# 这个选项代表等级上限，可以不设置，不设置的话就是没有上限

# 这里使用了第二种方案指定各个技能等级需要的经验值
xp-requirements:
  - 50
  - 125
  - 200
  - 300
  - 500
  - 750
  - 1000
  - 1500
  - 2000
  - 3500
  - 5000
  - 7500
  - 10000
  - 15000
  - 20000
  - 30000
  - 50000
  - 75000
  - 100000
  - 200000
  - 300000
  - 400000
  - 500000
  - 600000
  - 700000
  - 800000
  - 900000
  - 1000000
  - 1100000
  - 1200000
  - 1300000
  - 1400000
  - 1500000
  - 1600000
  - 1700000
  - 1800000
  - 1900000
  - 2000000
  - 2100000
  - 2200000
  - 2300000
  - 2400000
  - 2500000
  - 2600000
  - 2750000
  - 2900000
  - 3100000
  - 3400000
  - 3700000
  - 4000000
  - 5000000


# 技能等级提升后的奖励
# 你可以选择给予玩家属性或者解锁能力
# 属性和能力都有各自的等级，因此你还需要提供提升属性或者能力的等级
# 你也可以指定这个奖励开始和结束的等级值

# 一个奖励示例：
# - reward: strength # 属性或者能力ID
#   levels: 1 # 等级
#   start-level: 10 # 几级开始等级提升给予这个奖励
#   end-level: 20 # 几级开始等级提升不再给予这个奖励

rewards:
  - reward: defense
    levels: 2

  - reward: ferocity
    levels: 1
    start-level: 15

  - reward: versatile_tools
    levels: 1

  - reward: spelunking
    levels: 1
    start-level: 10

  - reward: dynamic_mining
    levels: 1


# 等级提升时执行的效果
# 使用 %level% 来表示技能等级的变量符
# 如果你想要这个效果只在某个等级或者等级范围时有效，可以按下面格式添加一个新的选项
# require: %level% == 20 或者 require: %level% < 50
level-up-effects:
  - id: give_money
    args:
      amount: 1000 * %level%


# 技能描述中使用的变量符
# 在描述中通过 %key% 格式使用它们，例如这里就是 %money% 和 %blocks%
placeholders:
  money: "%level% * 0.4"
  blocks: "ceil(10 - %level% / 10)"

# 等级奖励信息
# 等级提升后聊天框显示的内容
# 同时也是节能GUI内 %rewards% 变量符的内容

# 开始的数字代表的是开始显示这个等级奖励信息的等级
# 当检测到有另外一个等级可用时（例如10级将会显示这里设置的10）将会替代之前可用的信息
reward-messages:
  1:
    - " &8» &r&f+2 %ecoskills_defense_name%"
    - " &8» &r&6%ecoskills_versatile_tools_name% %ecoskills_versatile_tools_numeral%"
    - "    %ecoskills_versatile_tools_description%"
    - " &8» &r&6%ecoskills_dynamic_mining_name% %ecoskills_dynamic_mining_numeral%"
    - "    %ecoskills_dynamic_mining_description%"
  10:
    - " &8» &r&f+2 %ecoskills_defense_name%"
    - " &8» &r&6%ecoskills_versatile_tools_name% %ecoskills_versatile_tools_numeral%"
    - "    %ecoskills_versatile_tools_description%"
    - " &8» &r&6%ecoskills_spelunking_name% %ecoskills_spelunking_numeral%"
    - "    %ecoskills_spelunking_description%"
    - " &8» &r&6%ecoskills_dynamic_mining_name% %ecoskills_dynamic_mining_numeral%"
    - "    %ecoskills_dynamic_mining_description%"
  15:
    - " &8» &r&f+2 %ecoskills_defense_name%"
    - " &8» &r&f+1 %ecoskills_ferocity_name%"
    - " &8» &r&6%ecoskills_versatile_tools_name% %ecoskills_versatile_tools_numeral%"
    - "    %ecoskills_versatile_tools_description%"
    - " &8» &r&6%ecoskills_spelunking_name% %ecoskills_spelunking_numeral%"
    - "    %ecoskills_spelunking_description%"
    - " &8» &r&6%ecoskills_dynamic_mining_name% %ecoskills_dynamic_mining_numeral%"
    - "    %ecoskills_dynamic_mining_description%"

# 经验值获取方法
# 一个获取方法配置由 trigger，multiplier，conditions，filters 组成
# multiplier 加倍触发器的触发器属性中的值，加倍后的值就是获得的经验值
xp-gain-methods:
  - trigger: break_block
    multiplier: 0.5
    filters:
      blocks:
        - netherrack

  - trigger: break_block
    multiplier: 1
    filters:
      blocks:
        - stone
        - diorite
        - granite
        - andesite
        - cobblestone

# 获得技能经验值需要满足的条件
conditions: [ ]
```


---

# 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/ecoskills/chuang-jian-yi-ge-zi-ding-yi-ji-neng.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.
