Skip to content

主配置 config.yml

plugins/GTMobDrops/config.yml 控制 GTMobDrops 的全局行为。怪物掉落内容通常写在 drops/droppools/ 或 MythicMobs 的 GTDrops 中;config.yml 更适合配置开关、性能、属性加成、消息、存储、保护和兼容。

修改配置后执行:

text
/gtmd reload

涉及存储、授权、兼容插件加载顺序的配置,建议完整重启服务器。

基础设置 Settings

yaml
Settings:
  enabled: true
  debug: false
  language: "zh_CN"
字段作用推荐
enabled总开关。关闭后 GTMobDrops 不接管掉落正式环境保持 true
debug输出详细判定日志只在排错时打开
language语言中文环境保持 zh_CN

排查掉落问题时可以临时开启:

yaml
Settings:
  debug: true

测试完成后改回 false,避免控制台输出过多。

授权设置 Auth

yaml
Auth:
  enabled: true
  product: "GTMobDrops"
  allowMissingGTCore: false
字段作用
enabled是否向 GTCore 查询授权状态
product授权后台中的产品名
allowMissingGTCore未安装 GTCore 时是否允许启动

正式环境保持:

yaml
Auth:
  enabled: true
  product: "GTMobDrops"
  allowMissingGTCore: false

激活码写在 plugins/GTCore/config.yml,不是写在 GTMobDrops 的配置里。

性能设置 Performance

yaml
Performance:
  asyncProcessing: true
  maxDropsPerTick: 50
  cacheEnabled: true
  cacheExpireMinutes: 30
  cache:
    playerAttributeExpire: 60
  batchWrite:
    enabled: true
    batchSize: 100
    flushInterval: 5000
字段作用建议
asyncProcessing耗时操作放到后台线程保持 true
maxDropsPerTick每 tick 最大处理掉落数普通服 50,高并发可降低
cacheEnabled缓存解析后的掉落配置保持 true
cacheExpireMinutes掉落配置缓存过期时间10~30 分钟
playerAttributeExpire玩家属性缓存秒数30~60
batchWrite.enabled批量写入统计和日志保持 true
batchSize每批最大写入数量100 起步
flushInterval强制刷写间隔,毫秒5000 即 5 秒

高并发服务器推荐:

yaml
Performance:
  asyncProcessing: true
  maxDropsPerTick: 30
  cacheEnabled: true
  cacheExpireMinutes: 30
  cache:
    playerAttributeExpire: 60
  batchWrite:
    enabled: true
    batchSize: 200
    flushInterval: 5000

属性加成 AttributeBonus

属性加成用于读取 AttributePlus、CraneAttribute 等属性插件,让玩家身上的属性影响掉落概率、倍率和数量。

yaml
AttributeBonus:
  enabled: true
  dropRateAttribute: "掉落倍率"
  dropChanceAttribute: "掉落概率"
  dropAmountAttribute: "掉落数量"
  maxDropRate: 10.0
  maxDropChance: 1.0
  maxDropAmount: 100
  permissionBonus:
    gt.vip: 0.2
    gt.svip: 0.5
    gt.mvp: 1.0
  globalBonus: 0.0
字段作用
dropRateAttribute掉落数量倍率属性
dropChanceAttribute掉落概率加成属性
dropAmountAttribute掉落固定数量加成属性
maxDropRate掉落倍率上限
maxDropChance概率加成上限
maxDropAmount固定数量加成上限
permissionBonus权限加成
globalBonus全局活动加成

概率加成是独立额外机会。基础概率已经是 1.0 时,最终仍是 100%。

活动期间全服提高掉率:

yaml
AttributeBonus:
  enabled: true
  globalBonus: 0.5

这里表示额外 50% 加成机会,适合周末活动或节日活动。

物品独立加成 ItemBonus

ItemBonus 用于控制某些物品吃哪些加成。

yaml
ItemBonus:
  pure_luck_token:
    ignoreAll: true
  legendary_sword:
    allowedSources:
      - "ca:传说掉率"
      - "perm:gt.legend"
  no_global_item:
    blockedSources:
      - "global"
字段作用
ignoreAll忽略所有加成,完全按基础概率
allowedSources只允许列表里的加成来源生效
blockedSources禁止列表里的加成来源
extraSources给当前物品额外读取加成
conditions满足条件后加成才生效

加成来源写法:

text
ca:属性名
ap:属性名
perm:权限节点
global
set:套装ID

加成模式 BonusMode

yaml
BonusMode:
  mode: "D"
  modeD:
    mergeAmounts: true

四种模式:

模式说明适合场景
A每次加成命中只额外加 1 个稳定小幅加成
B每次加成命中额外加基础数量数值膨胀更明显
C多个加成合并算一次额外掉落保守产出
D基础和每个加成都独立判定RPG 掉落体验,默认推荐

modeD.mergeAmounts 控制多次掉落是否合并成一次显示。
希望掉落更整洁,使用 true;希望玩家看到多次判定效果,使用 false

CA 物品掉率 CARateBoost

CARateBoost 用于 CraneAttribute 的物品级掉率计算。

yaml
CARateBoost:
  enabled: true
  rateCalculation:
    preset: "hybrid"
    mode: "hybrid"

常用预设:

预设说明
add所有加成直接相加
multiply所有加成相乘
hybrid增益加法,降低乘法,默认推荐
weighted不同来源使用不同权重
custom自定义公式

多数服务器使用默认 hybrid 即可。

套装暗改 SetDarkDrop

yaml
SetDarkDrop:
  enabled: true
  order: "bonus_first"
字段作用
enabled是否启用套装暗改
order套装独立加成和暗改的计算顺序

可选顺序:

text
bonus_first  先算 bonusRate,再算暗改
dark_first   先算暗改,再算 bonusRate

套装本身写在 sets/ 目录或旧版 sets.yml 中。

多彩掉落 FancyDrop

yaml
FancyDrop:
  enabled: true
  offsetX: 0.5
  offsetY: 1.0
  offsetZ: 0.5
  angleType: "random"
  despawnTime: 300
字段作用
enabled是否启用掉落视觉效果
offsetX/Y/Z掉落位置偏移
angleType掉落排列方式
despawnTime掉落物存活秒数,-1 表示原版行为

angleType

text
random  随机散落
round   环形排列

大量掉落场景可关闭:

yaml
FancyDrop:
  enabled: false

掉落消息 Messages

yaml
Messages:
  enabled: true
  prefix: "&8[&6掉落&8] "
  dropMessage: "&7你获得了 &e{item} &7x{amount}"
  rareDropMessage: "&7你获得了 &6&l稀有 &e{item} &7x{amount}"
  rareThreshold: 0.1

变量:

text
{player} 玩家名
{item}   物品显示名
{amount} 数量
{mob}    怪物名

rareThreshold: 0.1 表示概率小于等于 10% 的掉落按稀有消息显示。

掉落动作 DropActions

DropActions 用于按稀有度执行标题、音效、广播、命令等动作。

yaml
DropActions:
  enabled: true
  rarities:
    legendary:
      threshold: 0.01
      actions:
        - type: "broadcast"
          message: "&6{player} 获得了传说掉落 {item}"
        - type: "sound"
          target: "player"
          sound: "ENTITY_PLAYER_LEVELUP"
          volume: 1.0
          pitch: 1.2

常用动作:

类型用途
message给玩家发消息
broadcast广播
sound播放声音
title屏幕标题
actionbar动作栏
particle粒子
command执行命令
delay延迟
condition条件动作

动作文本支持 PAPI 变量和 {player}{item}{amount}{chance} 等内置变量。

物品限流 DropLimit

yaml
DropLimit:
  enabled: true
  default:
    global: -1
    personal: -1
    time: "1D"
  limits:
    "ni:legend_sword":
      global: 10
      personal: 1
      time: "1W"
字段作用
global全服限制,-1 为无限制
personal单玩家限制,-1 为无限制
time重置周期

时间格式:

text
1D      1 天
1W      1 周
2W3D    2 周 3 天
1Y6M    1 年 6 月

适合控制传说装备、活动限定物品、赛季材料产出。

存储系统 Storage

yaml
Storage:
  mode: "local"
  skydrop: {}
  mysql: {}
模式说明
local本地 SkyDrop 存储,单服推荐
mysqlMySQL 存储,多服共享数据

单服使用:

yaml
Storage:
  mode: "local"

多服共享掉落记录:

yaml
Storage:
  mode: "mysql"
  mysql:
    host: "127.0.0.1"
    port: 3306
    database: "gtmobdrops"
    username: "root"
    password: "password"

切换存储模式后重启服务器。

统计与日志 PlayerStats / Log / DropLog

yaml
PlayerStats:
  enabled: true
  recentDropLimit: 50
  rankRefreshInterval: 300
  cacheFlushInterval: 30

PlayerStats 用于玩家统计、最近掉落、排行和 PAPI 数据。

yaml
Log:
  enabled: true
  compressInterval: 1440
  keepDays: 30
  logToConsole: false

Log 会记录详细掉落日志,适合追溯问题。

yaml
DropLog:
  enabled: true
  threshold: 0.1
  retentionDays: 30
  logToConsole: false

DropLog 是旧版审计日志,主要记录低概率掉落。threshold: 0.1 表示记录 10% 及以下的掉落。

兼容性 Compatibility

yaml
Compatibility:
  NeigeItems:
    enabled: true
    asyncFetch: true
  MythicMobs:
    enabled: true
    inheritVanillaDrops: true
  CraneAttribute:
    enabled: true
  AttributePlus:
    enabled: true
配置作用
NeigeItems.enabled是否接入 NI 物品库
NeigeItems.asyncFetch异步获取 NI 物品,降低主线程压力
MythicMobs.enabled是否读取 MM 怪物和物品
inheritVanillaDrops是否保留 MM/原版原有掉落
CraneAttribute.enabled是否读取 CA 属性
AttributePlus.enabled是否读取 AP 属性

如果某个生态插件没有安装,对应开关保持 true 一般也不会影响启动;需要排查时可临时关闭。

安全设置 Security

yaml
Security:
  enabled: true
  commandSecurity:
    whitelistMode: false
    blockedCommands:
      - "op"
      - "deop"
      - "stop"
      - "reload"

掉落动作可以执行命令,因此安全配置非常重要。
默认模式会拦截危险命令,防止配置错误导致玩家间接执行高危操作。

需要更严格时开启白名单:

yaml
Security:
  enabled: true
  commandSecurity:
    whitelistMode: true
    allowedCommands:
      - "give"
      - "broadcast"
      - "tell"
      - "playsound"

物品保护 ItemProtection

yaml
ItemProtection:
  enabled: true
  protection-time: 0
  allow-anyone-after-timeout: false
  allow-anyone-if-no-killer: true
字段作用
enabled是否启用掉落归属保护
protection-time保护秒数,0 表示直到被拾取
allow-anyone-after-timeout超时后是否允许任何人拾取
allow-anyone-if-no-killer没有击杀者时是否允许拾取

副本服推荐保护永久:

yaml
ItemProtection:
  enabled: true
  protection-time: 0
  allow-anyone-after-timeout: false

野外服想让掉落过一段时间可抢:

yaml
ItemProtection:
  enabled: true
  protection-time: 30
  allow-anyone-after-timeout: true

物品显示 ItemDisplay

yaml
ItemDisplay:
  enabled: true
  format: "{item-name} §6[§a{killer}§6] §fx {amount} §c{countdown}s"
  show-amount-only-when-stacked: true

可用变量:

text
{item-name}
{killer}
{killer_uuid}
{amount}
{countdown}

NI 物品会优先使用 NI 的显示名系统,此配置主要影响非 NI 物品。

AdyeshachDisplay

yaml
AdyeshachDisplay:
  enabled: true
  view-distance: 64.0
  update-interval: 10

用于掉落物名称虚拟显示。

字段作用
view-distance可视距离
update-interval跟随与清理检查间隔,20 tick = 1 秒

数值越低越顺滑,数值越高越省性能。普通服使用 10 即可。

CloudPick

yaml
CloudPick:
  enabled: false
  dropPush:
    enabled: false
    identifier: "gtmobdrops_drop"

用于云拾 UI 展示怪物掉落预览和掉落推送。没有云拾时保持关闭。

PAPI 变量格式:

text
%gtmobdrops_cp_怪物名_序号_属性%

属性支持:

text
id, name, ni, amount, chance, rarity, type, material, item

修改后验证

推荐流程:

text
/gtmd reload
/gtmd info
/gtmd preview ZOMBIE 200

如果涉及 MySQL、存储模式、授权、软依赖开关,执行完整重启。
如果只是消息、掉落动作、概率阈值、显示格式,通常重载即可。