导入任务
# 任务导入配置指南
在 AI 时代使用 GUI 进行创建任务效率越来越低下,所以在 2.10.0 更新导入任务功能
你可以把本文档喂给 AI 让按照格式生成任务
本文档详细说明如何通过 import.yml 配置文件批量导入任务到 PlayerTask 插件。
# 使用命令
/plk import
执行后会读取 plugins/PlayerTask/import.yml 文件并导入任务。新增的任务会自动回填 id 到配置文件中。
# 共享平台
这是专门为本插件制作的任务配置共享平台,欢迎大家使用和贡献更多任务
# 配置文件结构
tasks:
任务标识1:
# id: 1 # 可选,有id时更新已有任务,无id时新增(导入后自动回填)
taskName: "&f任务名称" # 必填,支持颜色代码
type: everyday # 可选,任务类型,默认 everyday
rarity: normal # 可选,任务稀有度,默认 normal
description: "任务描述" # 可选,任务描述文本
enableCommand: "say hello" # 可选,领取NPC任务时执行的命令
demands: # 必填,任务目标列表
- type: blockBreak
amount: 10
itemStack: OAK_LOG
rewards: # 必填,任务奖励列表
- type: vault
amount: 100
# 任务类型 (type)
| 类型值 | 说明 | 备注 |
|---|---|---|
everyday | 每日任务 | 默认值,每日随机刷新给玩家 |
npc | NPC任务 | 需要配合 NPC 插件使用 |
reel | 卷轴任务 | 通过任务卷轴物品触发 |
# 任务稀有度 (rarity)
| 稀有度值 | 说明 | 颜色代码 |
|---|---|---|
normal | 普通任务 | &f 白色 |
advanced | 高级任务 | &9 蓝色 |
rare | 稀有任务 | &5 紫色 |
rarer | 罕见任务 | &d 粉色 |
epic | 史诗任务 | &e 黄色 |
mythical | 神话任务 | &e&l 黄色加粗 |
# 任务目标类型 (demands)
# 基础格式
demands:
- type: 目标类型
amount: 数量
itemStack: 物品/怪物/材质标识
# 所有目标类型详解
# 1. craftItem - 合成物品
玩家需要合成指定物品。
- type: craftItem
amount: 5
itemStack: DIAMOND_SWORD # Minecraft 物品ID
# 2. blockBreak - 挖掘方块
玩家需要挖掘指定方块。
- type: blockBreak
amount: 64
itemStack: STONE # Minecraft 方块ID
# 3. Fish - 钓鱼
玩家需要钓起指定物品。
- type: Fish
amount: 10
itemStack: COD # 钓鱼获得的物品
# 4. Interact - 放置方块
玩家需要放置指定方块。
- type: Interact
amount: 20
itemStack: TORCH # 要放置的方块
# 5. kill - 击杀 MythicMobs 怪物
需要安装 MythicMobs 插件。
- type: kill
amount: 5
itemStack: SkeletonKing # MythicMobs 怪物ID
# 6. killNormal - 击杀普通怪物
击杀原版 Minecraft 怪物。
- type: killNormal
amount: 10
itemStack: zombie # 怪物类型,小写
# 7. killPlayer - 击杀玩家
PVP 任务,击杀其他玩家。
- type: killPlayer
amount: 3
itemStack: 玩家名称
# 8. killMp - 击杀 MonsterPlus 怪物
需要安装 MonsterPlus 插件。
- type: killMp
amount: 5
itemStack: boss_dragon # MonsterPlus 怪物ID
# 9. consume - 消耗/食用物品
玩家需要食用指定物品。
- type: consume
amount: 10
itemStack: COOKED_BEEF # 食物物品ID
# 10. submit - 提交物品
玩家需要提交指定物品(物品会被消耗)。
- type: submit
amount: 32
itemStack: IRON_INGOT # 要提交的物品
# 11. enchantment - 附魔物品
玩家需要附魔物品达到指定等级。
- type: enchantment
amount: 3 # 附魔等级
itemStack: SHARPNESS:1 # 附魔类型:等级 等级可不写默认最大等级
# 12. shear - 剪切
玩家需要剪羊毛或其他可剪切实体。
- type: shear
amount: 10
itemStack: wool # 可选 羊毛:wool 蘑菇煲:mushroom_stew
# 13. breed - 繁殖动物
玩家需要繁殖指定动物。
- type: breed
amount: 5
itemStack: cow # 动物类型,小写
# 14. tame - 驯服动物
玩家需要驯服指定动物。
- type: tame
amount: 2
itemStack: wolf # 动物类型,小写
# 15. chat - 发送聊天消息
需要安装 PlayerChat 插件。玩家需要发送包含指定内容的消息。
- type: chat
amount: 1
itemStack: 'hello' # 消息内容关键词
# 16. interaction - 交互
玩家需要与指定方块交互(右键点击)。
- type: interaction
amount: 10
itemStack: CHEST # 方块类型
# 17. command - 执行命令
玩家需要执行指定命令。
- type: command
amount: 1
itemStack: spawn # 命令内容不需要/
# 任务奖励类型 (rewards)
# 基础格式
rewards:
- type: 奖励类型
amount: 数量
itemStack: 附加参数 # 部分类型需要
description: "奖励描述" # 可选,显示在GUI中
# 所有奖励类型详解
# 1. vault - 金币奖励
需要安装 Vault 和经济插件。
- type: vault
amount: 500 # 金币数量
description: "500金币" # 可选
# 2. playerPoints - 点券奖励
需要安装 PlayerPoints 插件。
- type: playerPoints
amount: 100 # 点券数量
description: "100点券"
# 3. coin - 任务币奖励
PlayerTask 内置货币。
- type: coin
amount: 50 # 任务币数量
description: "50任务币"
# 4. itemStack - 物品奖励
给予玩家指定物品。
- type: itemStack
amount: 1 # 物品数量
itemStack: DIAMOND # 物品ID
description: "钻石x1"
# 5. command - 命令奖励
执行控制台命令,支持变量。
- type: command
amount: 1 # 执行次数
itemStack: 'give %player% diamond 5' # 命令
description: "获得5颗钻石"
命令格式说明:
%player%会被替换为玩家名称
# 6. player_currency_xxx - PlayerCurrency 多货币
需要安装 PlayerCurrency 插件。
- type: ply_point # ply + 货币ID
amount: 100
description: "100点券" # 可选介绍
# 完整配置示例
tasks:
# 新手任务 - 伐木
lumberjack:
taskName: "&f林间伐木工"
type: everyday
rarity: normal
description: "砍伐各种树木获取木材"
demands:
- type: blockBreak
amount: 20
itemStack: OAK_LOG
- type: blockBreak
amount: 10
itemStack: BIRCH_LOG
rewards:
- type: vault
amount: 100
- type: coin
amount: 10
# 中级任务 - 怪物猎人
monster_hunter:
taskName: "&9怪物猎人"
type: everyday
rarity: advanced
description: "清理危险的怪物"
demands:
- type: killNormal
amount: 15
itemStack: zombie
- type: killNormal
amount: 10
itemStack: skeleton
rewards:
- type: vault
amount: 300
- type: itemStack
amount: 5
itemStack: IRON_INGOT
description: "铁锭x5"
# 高级任务 - 矿工大师
master_miner:
taskName: "&5矿工大师"
type: everyday
rarity: rare
description: "深入地下挖掘珍贵矿石"
demands:
- type: blockBreak
amount: 10
itemStack: DIAMOND_ORE
- type: blockBreak
amount: 20
itemStack: GOLD_ORE
rewards:
- type: vault
amount: 1000
- type: command
amount: 1
itemStack: 'give %player% diamond 3'
description: "钻石x3"
# 史诗任务 - 驯兽师
beast_tamer:
taskName: "&e驯兽师"
type: everyday
rarity: epic
description: "驯服野生动物成为你的伙伴"
demands:
- type: tame
amount: 3
itemStack: wolf
- type: breed
amount: 5
itemStack: cow
rewards:
- type: vault
amount: 2000
- type: coin
amount: 100
- type: playerPoints
amount: 50
description: "50点券"
# NPC任务示例
npc_fishing_quest:
taskName: "&d渔夫的委托"
type: npc
rarity: rarer
description: "帮助渔夫收集鱼类"
enableCommand: "say %player% 接受了渔夫的委托"
demands:
- type: Fish
amount: 20
itemStack: COD
- type: Fish
amount: 10
itemStack: SALMON
rewards:
- type: vault
amount: 500
- type: itemStack
amount: 1
itemStack: FISHING_ROD
description: "钓鱼竿x1"
# 注意事项
任务标识(如
lumberjack、monster_hunter)只是配置文件中的 key,不会显示给玩家。id 字段:
- 首次导入时不需要填写
id,系统会自动生成并回填 - 再次导入时,有
id的任务会更新,无id的会新增
- 首次导入时不需要填写
itemStack 大小写:
- 方块/物品ID:建议大写(如
DIAMOND_ORE) - 怪物/动物类型:必须小写(如
zombie、wolf) - MythicMobs ID:保持原样
- 方块/物品ID:建议大写(如
颜色代码:
- 使用
&符号,如&a绿色、&c红色、&e黄色 &l加粗、&o斜体、&n下划线
- 使用
命令奖励:
- 支持 PlaceholderAPI 变量
去重机制:
- 导入时会自动检查已存在的任务目标和奖励
- 相同的目标/奖励会复用,不会重复创建