主配置
config.yml 是插件的主配置文件,包含全局设置、数据库和采集行为配置。
配置结构
settings:
debug: false
lock-same-block: true
main-hand-only: true
database:
enable: false
host: localhost
port: 3306
user: root
password: root
database: minecraft
table: iagather
gather:
max-distance: 4.5
cancel-on-item-change: true
remove-target-block: true
tools:
- "ia:example:collect_tool"
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}"
settings 全局设置
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
debug | boolean | false | 启用调试日志 |
lock-same-block | boolean | true | 锁定同一方块只能被一人采集,防止多人同时读条 |
main-hand-only | boolean | true | 只处理主手交互,避免主副手重复触发 |
database 数据库
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
enable | boolean | false | true 使用 MySQL,false 使用 SQLite |
host | string | localhost | MySQL 主机地址 |
port | integer | 3306 | MySQL 端口 |
user | string | root | 数据库用户名 |
password | string | root | 数据库密码 |
database | string | minecraft | 数据库名 |
table | string | iagather | 数据表名 |
SQLite 与 MySQL
- SQLite:数据存储在
plugins/IAGather/data.db,适合单服或小型服务器 - MySQL:适合多服共享数据或大型服务器
gather 采集行为
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
max-distance | double | 4.5 | 读条期间允许玩家离目标方块的最大距离 |
cancel-on-item-change | boolean | true | 读条过程中切换物品则取消采集 |
remove-target-block | boolean | true | 读条完成后是否移除目标 IA 方块 |
tools 采集工具白名单
定义哪些物品可以作为采集工具。支持两种格式:
ia:<namespaced_id>- ItemsAdder 物品,如ia:myitems:pickaxe_1vanilla:<MATERIAL>- 原版物品,如vanilla:DIAMOND_PICKAXE
tools:
- "ia:example:collect_tool"
- "ia:myitems:pickaxe_1"
- "vanilla:DIAMOND_PICKAXE"
placeholders 占位符映射
这些占位符会注入到 CustomCrops actions 的 placeholderMap 中。
| 占位符 | 说明 |
|---|---|
{skill-level} | 玩家采集等级 |
{skill-passive-bonus} | 被动技能加成 |
{skill-next-bonus} | 下一次采集加成 |
{gather-success} | 本次采集是否成功 |
{gather-target} | 采集目标 ID |
{gather-tool} | 使用的工具 |
{iagather} | IAGather 标识 |