新增功能
- 实时反馈: ActionBar、BossBar、侧边栏、音效和粒子效果,可单独配置。
- 冷却菜单:
/icd 或 /cooldowns,采用像素风格的紫/金边框,显示就绪状态、剩余时间和进度指示器。
- 内置 10 种语言: 英语、俄语、德语、西班牙语、法语、葡萄牙语、中文、日语、韩语和乌克兰语。
locale: auto: 使用每位玩家的客户端语言;设置 locale: ru(或其他代码)以强制使用指定语言。
- 可选的 PlaceholderAPI 集成,用于自定义 HUD 和菜单。
- 按玩家、按材质存储: 原子化的检查/启动机制防止并发尝试绕过正在运行的计时器。
- 限流的被阻止反馈: 每位玩家每秒最多一条消息/音效/粒子爆发;每次被禁止的尝试仍会被取消。
- 三叉戟在投掷时开始冷却,而非右键点击或充能期间。弓/弩在实际发射事件时触发。
- PvPManager 集成,并保留了 v1.01 中现有的
use-mode / 遗留 block-use 配置。
- 可选的 创造模式 → 生存模式 转换:当创造模式玩家攻击其他玩家时触发;默认关闭。
兼容性:目标 vs. 实际验证
目标支持: Minecraft 1.21–26.3,兼容 Bukkit 的服务端:Paper, Spigot, Bukkit, Purpur, Pufferfish, Leaves 和 Folia。不受支持的材料将通过名称解析,并在旧版本中自动跳过。
本工作区实际验证: Paper 1.21.11 build 132,配合原版客户端,以及 11 项独立的追踪器断言。这并非证明所有版本/核心组合均可用。Folia、Spigot、26.x 运行时环境以及 PlaceholderAPI 仍需单独的集成测试;请参阅 test report。
该插件编译为 Java 21 字节码。请使用您的 Minecraft 服务器所需的 Java 运行时环境;较新的 Minecraft 版本可能需要更新的 Java 版本。代理服务器(BungeeCord/Waterfall/Velocity)、Fabric 和 Quilt 不是独立的 Bukkit 插件宿主。兼容性桥接模块未经测试且不保证可用。
安装 / 升级
- 备份现有的配置文件和语言文件。
- 停止服务器。移除之前的 ItemCooldowns JAR 文件(不要同时保留两个版本)。
- 将
ItemCooldowns-2.0.0.jar 安装到 plugins/ 目录并启动服务器。
- 检查
plugins/ItemCooldowns/config.yml,特别是视觉选项和可选物品部分。
- 现有值和本地化自定义设置将被保留。若要完全采用新的翻译文本/颜色,请备份并重新生成旧的本地化文件。
无需资源包或客户端模组。原版库存界面保持原版外观;若需要完全自定义的深色库存背景,则需要资源包。本菜单使用彩色玻璃边框和样式化文本,无需额外资源包即可实现。
默认规则
| 物品 |
持续时间 |
默认启用 |
触发条件 |
| 胸甲 (Mace) |
45 s |
是 |
PvP 命中 |
| 长矛 (仅限可用材料) |
5 s |
是 |
攻击/使用 |
| 三叉戟 |
5 s |
是 |
实际投射物发射、近战攻击、激流事件 |
| 末影水晶 |
45 s |
是 |
右键点击方块使用尝试 |
| 重生锚 |
45 s |
是 |
右键点击方块使用尝试 |
| 末影珍珠 |
5 s |
否 |
右键点击使用 |
| 弓 |
2 s |
否 |
发射 |
| 弩 |
5 s |
否 |
发射 |
| 盾牌 |
5 s |
否 |
右键点击使用 |
| 不死图腾 |
30 s |
否 |
复活事件 |
| 旋风电荷 |
3 s |
否 |
右键点击使用 |
断开连接时冷却时间重置,且不会持久保存。水晶/锚的规则限制的是使用尝试,而非确认成功的放置。绕过权限默认为 false,包括操作员在内。
命令
别名:/itemcooldowns, /icd, /cooldowns。
| 命令 |
用途 |
权限 |
/icd 或 /icd gui |
打开实时菜单 |
itemcooldowns.use (默认 true) |
/icd check [item] |
检查剩余时间 |
所有人 |
/icd help |
帮助信息 |
所有人 |
/icd reset [player] |
清除计时器;省略玩家参数表示清除自己的 |
itemcooldowns.admin |
/icd reload |
重载配置/语言文件;清除插件计时器 |
itemcooldowns.admin |
配置
完整的带注释 config.yml 随 JAR 包一起提供。
locale: auto # 或 en, ru, de, es, fr, pt, zh, ja, ko, uk
pvp-only: true
creative-to-survival-on-player-hit: false
visuals:
actionbar:
enabled: true
bossbar:
enabled: true
scoreboard:
enabled: true
gui:
enabled: true
sounds:
enabled: true
particles:
enabled: true
trident:
enabled: true
cooldown-seconds: 5
cancel-action: true
overlay: true
bypass-permission: itemcooldowns.bypass.trident
actionbar: true
bossbar: true
侧边栏互操作性: 如果另一个插件占用了侧边栏,请禁用 visuals.scoreboard.enabled。ItemCooldowns 会在计时器激活期间临时替换玩家的计分板,并尝试在之后恢复之前的计分板。
原版覆盖层 vs. 被阻止的反馈: 白色槽位覆盖层可能导致客户端抑制重复的使用数据包。服务器无法对从未接收到的数据包显示新的被阻止消息。对于服务器驱动的被阻止反馈(如水晶),请将该规则的 overlay: false;ActionBar/BossBar/侧边栏仍将显示计时器。画廊截图对此类水晶使用了此设置。
worlds.enabled、worlds.whitelist 和 worlds.list 提供世界过滤功能。仅在确实需要该玩法变更时,将 Creative → Survival(创造模式转生存模式)选项设置为 true。
武器使用策略(源自 v1.01 合并)
矛和三叉戟规则接受 use-mode: block、damage 或 no-damage(旧版 block-use: false 映射为 damage)。新版默认值使用 block,以便保持基于投掷的三叉戟冷却时间启用。现有的显式 use-mode 值保持不变。
block: 在冷却时间激活期间禁止使用。
damage: 允许在伤害被限制时进行移动/投掷。三叉戟计时器仍在发射时启动;在冷却期间发射的投射物标记为无害,而第一次有效投掷可正常造成伤害。
no-damage: 允许使用但抑制其伤害。近战仍然独立受冷却时间限制。
矛/Riptide(激流)的移动伤害抑制使用 1.5 秒的归因窗口作为兼容性启发式方法。它也可以抑制该窗口内的近战伤害。这些可选策略和已安装的 PvPManager 尚未在此次版本中进行过游戏内集成测试。
语言 / 自定义
首次启动时会提取所有十种内置语言的 lang/messages-<code>.yml 文件。缺失的键会回退到内置的英文模板。要添加自定义语言,请复制一个模板并设置 locale: <code>。自动选择识别十种内置语言族,包括区域客户端代码,例如 pt_br。
消息占位符:{item}、{seconds}、{progress}、{player}(视情况而定)。支持 & 格式化和 &#RRGGBB 十六进制颜色。声音和粒子可以独立禁用;未知的枚举名称会被忽略。
权限
itemcooldowns.use: 菜单访问,默认 true。
itemcooldowns.admin: 重载/重置,默认操作员。
itemcooldowns.bypass: 绕过所有规则,默认 false。
itemcooldowns.bypass.<item-key>: 绕过单个规则,默认 false。
物品键:mace、spear、trident、end-crystal、respawn-anchor、ender-pearl、bow、crossbow、shield、totem、wind-charge。
LuckPerms 示例:/lp group vip permission set itemcooldowns.bypass.trident true。
PlaceholderAPI(可选)
安装 PlaceholderAPI;扩展会自动注册。无需从 eCloud 下载。
| 占位符 |
结果 |
%itemcooldowns_active% |
活动冷却数量 |
%itemcooldowns_nearest% |
选定的活动物品键或 ready |
%itemcooldowns_nearest_seconds% |
选定计时器的秒数,或 0 |
%itemcooldowns_trident_seconds% |
三叉戟剩余秒数 |
%itemcooldowns_trident_ready% |
true / false |
将 trident 替换为其他物品键以获取特定物品的占位符。当前的 nearest(最近)选择使用最长剩余计时器。对于多材质规则,特定物品状态显示其材质中最长的剩余计时器;追踪器分别存储每种材质。
画廊
来自隔离 Paper 测试服务器的真实截图,非 AI 概念图。四张展示卡片仅添加了外部排版/边框。未经处理的截图包含在 docs/gallery/originals 中。

构建 / 测试
Java 21+ 和 Maven 3.9+:
mvn package
bash tools/test-tracker.sh
输出:target/ItemCooldowns-2.0.0.jar。独立的追踪器测试由脚本显式调用;它不是由 Surefire 自动执行的 JUnit 套件。要重新生成展示画廊,请安装 Pillow 并运行 python3 tools/make-gallery.py(该脚本使用 DejaVu 字体)。
许可证
MIT · Sooqwess
ItemCooldowns · 2.0
Clear timing. Fair fights.
PvP item cooldowns with a purple-and-gold menu, live timers and per-player protection.
Modrinth · Gallery · Test report

What's new
- Live feedback: ActionBar, BossBar, sidebar, sounds and particles, individually configurable.
- Cooldown menu:
/icd or /cooldowns, with a pixel-style purple/gold border, ready status, remaining time and a progress indicator.
- 10 bundled languages: English, Russian, German, Spanish, French, Portuguese, Chinese, Japanese, Korean and Ukrainian.
locale: auto: use each player's client language; set locale: ru (or another code) to force one language.
- Optional PlaceholderAPI integration for custom HUDs and menus.
- Per-player, per-material storage: atomic check/start prevents concurrent attempts from bypassing a running timer.
- Spam-limited blocked feedback: at most one message/sound/particle burst per player per second; every disallowed attempt is still cancelled.
- Tridents start on launch, not on right-click or during charging. Bows/crossbows use the actual shot event.
- PvPManager integration and the existing
use-mode / legacy block-use configuration are preserved from v1.01.
- Optional Creative → Survival conversion when a Creative player hits another player; off by default.
Compatibility: target vs. verification
Target: Minecraft 1.21–26.3, on Bukkit-compatible servers: Paper, Spigot, Bukkit, Purpur, Pufferfish, Leaves and Folia. Unsupported materials are resolved by name and automatically skipped on older versions.
Actually verified in this workspace: Paper 1.21.11 build 132, with a real vanilla client, plus 11 standalone tracker assertions. This is not proof that every version/core combination works. Folia, Spigot, the 26.x runtime and PlaceholderAPI still require separate integration tests; see the test report.
The plugin is compiled to Java 21 bytecode. Use the Java runtime required by your Minecraft server; newer Minecraft releases may require a newer Java version. Proxy servers (BungeeCord/Waterfall/Velocity), Fabric and Quilt are not standalone Bukkit plugin hosts. Compatibility bridges are not tested or guaranteed.
Installation / upgrade
- Back up the existing configuration and language files.
- Stop the server. Remove the previous ItemCooldowns JAR (do not keep both versions).
- Install
ItemCooldowns-2.0.0.jar into plugins/ and start the server.
- Review
plugins/ItemCooldowns/config.yml, particularly the visual and optional-item sections.
- Existing values and on-disk locale customizations are retained. To adopt the new translated wording/colors fully, back up and regenerate the old locale files.
No resource pack or client mod is required. Vanilla inventory chrome stays vanilla; a fully custom dark inventory background would require a resource pack. The menu uses colored glass borders and styled text without one.
Default rules
| Item |
Duration |
Enabled by default |
Trigger |
| Mace |
45 s |
Yes |
PvP hit |
| Spear (available materials only) |
5 s |
Yes |
Attack/use |
| Trident |
5 s |
Yes |
Actual projectile launch, melee attack, Riptide event |
| End crystal |
45 s |
Yes |
Right-click block use attempt |
| Respawn anchor |
45 s |
Yes |
Right-click block use attempt |
| Ender pearl |
5 s |
No |
Right-click use |
| Bow |
2 s |
No |
Shot |
| Crossbow |
5 s |
No |
Shot |
| Shield |
5 s |
No |
Right-click use |
| Totem |
30 s |
No |
Resurrect event |
| Wind charge |
3 s |
No |
Right-click use |
Cooldowns reset on disconnect and are not persisted. Crystal/anchor rules gate use attempts, not confirmed successful placements. Bypass permissions default to false, including for operators.
Commands
Aliases: /itemcooldowns, /icd, /cooldowns.
| Command |
Purpose |
Permission |
/icd or /icd gui |
Open the live menu |
itemcooldowns.use (default true) |
/icd check [item] |
Check remaining time |
Everyone |
/icd help |
Help |
Everyone |
/icd reset [player] |
Clear timers; omitted player means yourself |
itemcooldowns.admin |
/icd reload |
Reload config/locales; clears plugin timers |
itemcooldowns.admin |
Configuration
The complete, commented config.yml ships in the JAR.
locale: auto # or en, ru, de, es, fr, pt, zh, ja, ko, uk
pvp-only: true
creative-to-survival-on-player-hit: false
visuals:
actionbar:
enabled: true
bossbar:
enabled: true
scoreboard:
enabled: true
gui:
enabled: true
sounds:
enabled: true
particles:
enabled: true
trident:
enabled: true
cooldown-seconds: 5
cancel-action: true
overlay: true
bypass-permission: itemcooldowns.bypass.trident
actionbar: true
bossbar: true
Sidebar interoperability: disable visuals.scoreboard.enabled if another plugin owns the sidebar. ItemCooldowns temporarily replaces the player's scoreboard while a timer is active and tries to restore the previous one afterwards.
Vanilla overlay vs. blocked feedback: the white slot overlay may make the client suppress repeated use packets. The server cannot display a new blocked message for a packet it never receives. For server-driven blocked feedback on items such as crystals, set that rule's overlay: false; ActionBar/BossBar/sidebar still show the timer. Gallery capture uses this setting for crystals.
worlds.enabled, worlds.whitelist and worlds.list provide world filtering. Set the Creative → Survival option to true only if that gameplay change is intended.
Weapon use policy (merged from v1.01)
Spear and trident rules accept use-mode: block, damage, or no-damage (legacy block-use: false maps to damage). Fresh v2 defaults use block so the launch-based trident cooldown remains enabled. Existing explicit use-mode values are kept.
block: disallow a use while its cooldown is active.
damage: allow movement/throws while damage is gated. A trident timer still starts at launch; projectiles launched during cooldown are marked harmless, while the first valid throw can damage normally.
no-damage: allow the use but suppress its damage. Melee remains independently cooldown-gated.
Spear/Riptide movement-damage suppression uses a 1.5-second attribution window, as a compatibility heuristic. It can also suppress melee within that window. These optional policies and installed PvPManager have not had an in-game integration test in this delivery.
Languages / customization
The first launch extracts lang/messages-<code>.yml for all ten bundled languages. Missing keys fall back to the bundled English template. To add a custom language, copy a template and set locale: <code>. Auto selection recognizes the ten bundled language families, including regional client codes such as pt_br.
Message placeholders: {item}, {seconds}, {progress}, {player} where relevant. Supports & formatting and &#RRGGBB hex colors. Sounds and particles can be disabled independently; unknown enum names are ignored.
Permissions
itemcooldowns.use: menu access, default true.
itemcooldowns.admin: reload/reset, default operators.
itemcooldowns.bypass: bypass all rules, default false.
itemcooldowns.bypass.<item-key>: bypass a single rule, default false.
Item keys: mace, spear, trident, end-crystal, respawn-anchor, ender-pearl, bow, crossbow, shield, totem, wind-charge.
LuckPerms example: /lp group vip permission set itemcooldowns.bypass.trident true.
PlaceholderAPI (optional)
Install PlaceholderAPI; the expansion registers automatically. No eCloud download is needed.
| Placeholder |
Result |
%itemcooldowns_active% |
Active cooldown count |
%itemcooldowns_nearest% |
Selected active item key or ready |
%itemcooldowns_nearest_seconds% |
Selected timer in seconds, or 0 |
%itemcooldowns_trident_seconds% |
Trident remaining seconds |
%itemcooldowns_trident_ready% |
true / false |
Replace trident with another item key for the item-specific placeholders. The current nearest selection uses the longest remaining timer. For multi-material rules, item-specific status shows the longest remaining timer across their materials; the tracker stores each material separately.
Gallery
Real captures from an isolated Paper test server, not AI concepts. Four presentation cards add external typography/framing only. Untouched screenshots are included in docs/gallery/originals.

Build / test
Java 21+ and Maven 3.9+:
mvn package
bash tools/test-tracker.sh
Output: target/ItemCooldowns-2.0.0.jar. The standalone tracker test is explicitly invoked by the script; it is not a JUnit suite automatically executed by Surefire. To regenerate the presentation gallery, install Pillow and run python3 tools/make-gallery.py (the script uses DejaVu fonts).
License
MIT · Sooqwess
评论 0
登录后参与评分
还没有评论,来抢沙发吧