模板与生成点
GTRather 的配置分两层:
| 文件 | 负责内容 |
|---|---|
templates.yml | 采集点长什么样、怎么采、给什么奖励、需要什么条件 |
spawns.yml | 采集点刷在哪个世界、哪个坐标、刷几个、多久刷新 |
一句话理解:模板是“规则”,生成点是“位置”。
最小模板
放入 plugins/GTGather/templates.yml:
yaml
templates:
diamond_test:
display: "§b§l测试钻石"
entity-type: TEXT_DISPLAY
description:
- "§7右键采集"
- "§7奖励:钻石 ×1"
cast:
enabled: true
duration: "0"
cooldown: "10s"
rewards:
r1:
id: DIAMOND
amount: "1"
mode: INVENTORY效果:
- 玩家看到一个文字采集点。
- 右键立即完成采集。
- 奖励 1 个钻石。
- 采集后冷却 10 秒。
最小生成点
放入 plugins/GTGather/spawns.yml:
yaml
spawns:
hub_diamond:
template: diamond_test
type: POINT
point:
world: world
x: 100.5
y: 64.0
z: 200.5
yaw: 0.0
pitch: 0.0效果:
- 在
world的100.5,64,200.5生成一个采集点。 - 使用
diamond_test模板。
模板字段
display
采集点显示名:
yaml
display: "§f§l铁矿"支持颜色代码和 PAPI:
yaml
display: "§a%player_name% 的专属草药"entity-type
展示实体类型:
yaml
entity-type: ARMOR_STAND常用:
| 类型 | 适合场景 |
|---|---|
ARMOR_STAND | 兼容性好,适合方块、物品展示 |
TEXT_DISPLAY | 高版本文字展示,适合提示点、纯文字资源 |
PIG、PLAYER | 特殊展示玩法 |
display-item
采集点戴在头上的物品:
yaml
display-item: IRON_ORE支持物品库:
yaml
display-item: "ni:ruby"
display-item: "mm:LEGEND_SWORD"不写 display-item 时,盔甲架不会戴展示物品。
description
采集点下面的多行说明:
yaml
description:
- "§7需要铁镐采集"
- "§71 小时最多 5 次"描述适合写条件、奖励、冷却和玩法提示。
采集读条
3 秒采集,BossBar 显示进度:
yaml
cast:
enabled: true
duration: "3.0"
progress-bar: BOSS_BAR
cooldown: "30s"可用进度条:
| 类型 | 显示位置 |
|---|---|
ACTION_BAR | 动作栏 |
BOSS_BAR | Boss 血条 |
TITLE | 屏幕标题 |
等级越高采集越快:
yaml
cast:
enabled: true
duration: "5 - %player_level% / 20"
progress-bar: ACTION_BAR
cooldown: "30s"duration 支持 PAPI 和算术表达式。
冷却显示
采集点冷却时更换显示:
yaml
cast:
enabled: true
duration: "3.0"
cooldown: "30s"
cooldown-display:
name: "§7§l冷却中 {cooldown}"
display-item: GRAY_STAINED_GLASS_PANE
display-scale: 0.8
y-offset: -0.5
cooldown-lines:
- "§7距刷新还剩 §f{cooldown}"
- "§8纯数字:{cooldown_seconds} 秒"
cooldown-format: "mm:ss"可用变量:
| 变量 | 内容 |
|---|---|
{cooldown} | 格式化后的剩余时间 |
{cooldown_seconds} | 剩余秒数 |
cooldown-format 常用值:
text
compact
mm:ss
hh:mm:ss
full触发条件
手持原版物品
手持铁镐才能采:
yaml
triggers:
t1:
pattern: "*iron_pickaxe*"pattern 会匹配物品名、Material 和通配符。
手持 NI 物品
yaml
triggers:
t1:
id: "ni:warrior_pickaxe"手持 MM 物品
yaml
triggers:
t1:
id: "mm:GOLD_PICKAXE_TIER_5"PAPI 条件
30 级以上才能采:
yaml
triggers:
t1:
expression: "%player_level% >= 30"职业限制:
yaml
triggers:
t1:
expression: "%player_class% == WARRIOR"多个 trigger 是 AND 关系:
yaml
triggers:
t1:
id: "ni:warrior_pickaxe"
t2:
expression: "%player_level% >= 30"POINT 固定点
固定点永远在同一个坐标生成:
yaml
spawns:
hub_iron_singleton:
template: iron_ore_block
type: POINT
point:
world: world
x: 100.5
y: 64.0
z: 200.5
yaw: 0.0
pitch: 0.0适合:
- 主城固定 NPC 采集点。
- 副本门口兑换/采集点。
- 任务专用资源。
AREA 区域随机点
在中心点半径内随机刷多个采集点:
yaml
spawns:
mine_diamond_cluster:
template: level_scaled
type: AREA
point:
world: world
x: 50.0
y: 12.0
z: 50.0
yaw: 0.0
pitch: 0.0
range: 8.0
max-amount: 5
per-respawn: 60
cooldown: "30s"含义:
- 以
50,12,50为中心。 - 半径 8 格内随机生成。
- 同时最多存在 5 个。
- 每 60 秒补一个。
- 玩家采集后有 30 秒冷却。
适合矿区、树林、药田、副本资源区。
完整示例:铁矿点
templates.yml:
yaml
templates:
iron_ore_block:
display: "§f§l铁矿"
entity-type: ARMOR_STAND
display-item: IRON_ORE
display-scale: 1.0
glowing: true
description:
- "§7需要铁镐采集"
- "§71 小时最多 5 个"
triggers:
t1:
pattern: "*iron_pickaxe*"
cast:
enabled: true
duration: "2.5"
progress-bar: BOSS_BAR
cooldown: "20s"
rewards:
r1:
id: RAW_IRON
amount: "1"
mode: INVENTORY
r2:
command:
- "console:xp give %player% 5"
limit:
player:
enabled: true
count: 5
period: "1h"spawns.yml:
yaml
spawns:
surface_iron_area:
template: iron_ore_block
type: AREA
point:
world: world
x: 0.0
y: 80.0
z: 0.0
yaw: 0.0
pitch: 0.0
range: 15.0
max-amount: 10
per-respawn: 15
cooldown: "5s"创建和测试
- 修改
templates.yml和spawns.yml。 - 执行
/gtgather reload。 - 进入生成点所在世界。
- 检查采集点是否出现。
- 右键采集点测试条件、读条、奖励和冷却。
如果使用工具创建:
text
/gtgather wand然后左键空气选择模板,右键地面创建生成点。
常见问题
采集点没有出现
检查:
spawns.yml的template是否存在。world是否写对。- 坐标是否在已加载区块。
/gtgather reload是否报错。
采集点能看到但不能采
检查:
- 玩家距离是否超过
config.yml的trigger.range。 triggers是否满足。- PAPI 变量是否能正常解析。
- 手持物品 ID 是否真实存在。
冷却显示不变
检查:
cast.cooldown是否大于 0。cooldown-display是否写在cast下。cooldown-lines是否为列表。- 重载后是否仍使用旧模板。
