占位符
IAGather 提供的占位符可在 targets.yml 的表达式和动作中使用。
可用占位符
| 占位符 | 说明 | 示例值 |
|---|---|---|
{skill-level} | 玩家采集等级 | 10 |
{skill-passive-bonus} | 被动技能加成值 | 0.15 |
{skill-next-bonus} | 下一次采集加成值 | 0.3 |
{gather-success} | 本次采集是否成功 | true / false |
{gather-target} | 采集目标 ID | example:ore_1 |
{gather-tool} | 使用的工具 ID | ia:example:tool |
{iagather} | IAGather 标识 | true |
在表达式中使用
成功率表达式
success-expression: "0.6 + {skill-level} * 0.01 + {skill-passive-bonus} + {skill-next-bonus}"
掉落概率
on-success:
action_1:
type: drop-item
chance: "0.5 + {skill-level} * 0.02"
value:
item: "example:drop_1"
min: 1
max: "1 + {skill-level} * 0.1"
在消息中使用
on-success:
action_1:
type: message
value: "&a你成功采集了 {gather-target}!"
占位符映射配置
config.yml 中的 placeholders 部分定义了占位符如何传递给 CustomCrops:
placeholders:
skill-level: "{skill-level}"
skill-passive-bonus: "{skill-passive-bonus}"
skill-next-bonus: "{skill-next-bonus}"
gather-success: "{gather-success}"
gather-target: "{gather-target}"
gather-tool: "{gather-tool}"
iagather-flag: "{iagather}"
通常不需要修改此配置。