跳到主要内容

主配置

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 全局设置

字段类型默认值说明
debugbooleanfalse启用调试日志
lock-same-blockbooleantrue锁定同一方块只能被一人采集,防止多人同时读条
main-hand-onlybooleantrue只处理主手交互,避免主副手重复触发

database 数据库

字段类型默认值说明
enablebooleanfalsetrue 使用 MySQL,false 使用 SQLite
hoststringlocalhostMySQL 主机地址
portinteger3306MySQL 端口
userstringroot数据库用户名
passwordstringroot数据库密码
databasestringminecraft数据库名
tablestringiagather数据表名
SQLite 与 MySQL
  • SQLite:数据存储在 plugins/IAGather/data.db,适合单服或小型服务器
  • MySQL:适合多服共享数据或大型服务器

gather 采集行为

字段类型默认值说明
max-distancedouble4.5读条期间允许玩家离目标方块的最大距离
cancel-on-item-changebooleantrue读条过程中切换物品则取消采集
remove-target-blockbooleantrue读条完成后是否移除目标 IA 方块

tools 采集工具白名单

定义哪些物品可以作为采集工具。支持两种格式:

  • ia:<namespaced_id> - ItemsAdder 物品,如 ia:myitems:pickaxe_1
  • vanilla:<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 标识