# 创建一个新的任务

创建一个新的任务 `Swiming Man` ：

* 任务目标为游泳 **100m**
* &#x20;必须在 **'world'** 世界内
* &#x20;将任务添加至 **DailyQuest**

## 开始编写任务

### 1.编写任务目标&#x20;

你会发现，似乎没有游泳这个目标类型?

所以这时候我们需要用到 conditions 来实现它 [任务目标列表](/legendarydailyquests/ren-wu-pei-zhi/ren-wu-mu-biao-lie-biao.md)

```
goals:
  swim:
    type: MOVE
    value: '' #该目标类型可以不设置 value.
    amount: 100 #100m
    conditions:
    - "[world]world" #检测当前世界是否为 world
    #如果你的服务端版本高于1.13
    - "[swim]" #检测玩家是否在游泳
    #如果低于1.13
    - "[stand]WATER" #检测玩家是否在水中
```

到此, 任务目标部分编写完成

### 2.编写任务基础部分

```
display: "&fSwiming Man"
material: IRON_BOOTS
amount: 1
model: 0
description:
  # 因为任务目标的id我们设置为 swim 所以这里用 %progress_swim% 来表示该任务的进度
  - " &7&l· &#bcd2ee游泳100m &f(&c%progress_swim%/100&f)"
reward_description:
  - " &7&l· &#9AFF9A游戏币 ×100"
goals:
  swim:
    type: MOVE
    value: ''
    amount: 100
    conditions:
    - "[world]world"
    - "[swim]"
reward:
  run:
    - 'console_command;eco give %player% 100'
```

### 3.保存文件

保存该任务文件到 `Quests` 文件夹并将其命名为 `Swimming_Man.yml`&#x20;

### 4.将任务添加到任务周期 DailyQuests 配置文件内

打开位于 `Categories`  的 `DailyQuests.yml` &#x20;

将该任务的文件名写入 `settings.quests`

```
settings:
  display: '&eDaily Quests'
  refresh: 1
  amount: 5
  quests:
    - Butcher
    - Golden_Miner
    - Material_Shortage_1
    - Material_Shortage_2
    - Stonemason
    - Happy_Trade
    - Hunger
    - Running_Man
    - Adventurer
    - Adventurer_2
    - Adventurer_3
    - Adventurer_4
    - Hungriness
    - Farmer
    - Farmer_2
    - Goodbye_World
    - FishMan
    - FishMan2
    - Breeder
    - Blacksmith
    - Clother
    - Warrior
    - Enchanter
    - Timer
    - Refiner
    - Swimming_Man #在此 在此 在此
```

### 5.重载插件

之后你就可以随机到该任务了！

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


---

# 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://gyzer.gitbook.io/legendarydailyquests/ren-wu-pei-zhi/ren-wu-mu-ban/chuang-jian-yi-ge-xin-de-ren-wu.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.
