# 创建一个自定义职业

## 示例配置

示例配置如下：

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

# 职业的显示名称
name: "&#x26;6任务"

# 职业的描述
description: "&#x26;8&#x26;o通过挖掘方块升级"

# 是否默认处于解锁状态
unlocked-by-default: true

# 在离开职业后是否清除职业数据
reset-on-quit: false

# 加入该职业的价格
join-price:
  value: 0
  type: coins
  display: "&#x26;a$%value%"

# 当玩家未加入该职业时点击职业图标想要加入该职业时的Lore内容
# 即 %join_lore% 变量符的内容
join-lore: []

# 离开该职业的价格
leave-price:
  value: 20000
  type: coins
  display: "&#x26;a$%value%"

# 当玩家已加入该职业时点击职业图标想要离开该职业时的Lore内容
# 即 %leave_lore% 变量符的内容
leave-lore:
  - " &#x26;8» 离开该职业需要花费 %leave_price%"

# 指定各个等级所需的经验值，每一行代表新的一级
level-xp-requirements:
  - 100
  - 120
  - 150
  - 180
  - 210
  - 250
  - 300
  - 360
  - 430
  - 520
  - 620
  - 740
  - 890
  - 1000
  - 1300
  - 1500
  - 1900
  - 2200
  - 2700
  - 3200
  - 3800
  - 4600
  - 5500
  - 6600
  - 7900
  - 9500
  - 11500
  - 14000
  - 17000
  - 19000
  - 24000
  - 29000
  - 34000
  - 41000
  - 50000
  - 60000
  - 70000
  - 85000
  - 100000
  - 120000
  - 150000
  - 180000
  - 210000
  - 250000
  - 300000
  - 360000
  - 440000
  - 580000
  - 750000

# 经验值获取方法
# 一个获取方法配置由 trigger，multiplier，conditions，filters 组成
# multiplier 加倍触发器的触发器属性中的值，加倍后的值就是获得的经验值
xp-gain-methods:
  - trigger: mine_block
    multiplier: 0.5
    conditions: [ ]
    filters:
      items:
        - "*wooden_pickaxe"
        - "*stone_pickaxe"
        - "*iron_pickaxe"
        - "*golden_pickaxe"
        - "*diamond_pickaxe"
        - "*netherite_pickaxe"

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

# %effects% 变量符显示的文本

# 开始的数字代表的是开始显示这个等级奖励信息的等级
# 当检测到有另外一个等级可用时（例如10级将会显示这里设置的10）将会替代之前可用的信息
effects-description:
  1:
    - "&#x26;8» &#x26;8每挖掘 &#x26;a%blocks% &#x26;8个方块获得 &#x26;a$%money%&#x26;8 金币"

# %rewards% 变量符显示的文本
rewards-description:
  1:
    - "&#x26;8» &#x26;8每挖掘 &#x26;a%blocks% &#x26;8个方块获得 &#x26;a$%money%&#x26;8 金币"

# %level_up_messages% 变量符显示的文本
level-up-messages:
  1:
    - "&#x26;8» &#x26;8每挖掘 &#x26;a%blocks% &#x26;8个方块获得 &#x26;a$%money%&#x26;8 金币"

# 每次升级后执行的指令，有两种格式:
# 等级值:指令 (例如. 10:eco give %player% 1000)，代表升到10级后执行这个指令
# 指令 (e.g. eco give %player% 5000)，代表每次升级都执行这个指令
<strong>level-commands: [ ]
</strong>
# 职业的效果
# 使用 %level% 来表示职业等级的变量符
effects:
  - id: give_money
    args:
      every: "ceil(10 - %level% / 10)"
      amount: "0.4 * %level%"
    filters:
      items:
        - "*wooden_pickaxe"
        - "*stone_pickaxe"
        - "*iron_pickaxe"
        - "*golden_pickaxe"
        - "*diamond_pickaxe"
        - "*netherite_pickaxe"
    triggers:
      - mine_block

# 职业效果能够激活的条件
# 你仍可以使用 %level% 变量符
conditions: [ ]

# 职业在GUI内的图标
icon: player_head texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvODU3MDVjZjg2NGRmMmMxODJlMzJjNDg2YjcxNDdjYmY3ODJhMGFhM2RmOGE2ZDYxNDUzOTM5MGJmODRmYjE1ZCJ9fX0=
</code></pre>


---

# 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/ecojobs/chuang-jian-yi-ge-zi-ding-yi-zhi-ye.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.
