Combat Persistence
有人正在战斗中落败,于是他们退出了游戏。在大多数服务器上,事情到此为止:他们是安全的,并且保留着他们的物品。
但有了这个模组就不是这样了。如果玩家处于战斗状态时离开,一个副本会留在原地直到战斗计时器结束,穿着他们的装备。杀死它会掉落他们的物品。当他们重新登录时,他们就死了。
它仅在服务器上运行。你的玩家不需要安装任何东西。

工作原理
- 攻击另一名玩家会使双方进入持续 15 秒的战斗状态。倒计时显示在快捷栏上方。你可以在配置中更改持续时间。
- 如果你在战斗期间注销,一个带有你装备的
[OFFLINE]假人模型会停留在你站立的位置。 - 如果有人杀死了假人模型,你的物品会掉落,并且你下次加入时会死亡。
- 如果计时器耗尽前没有人杀死它,它就会消失,当你重新登录时会拿回所有物品。
- 只有 PvP 会启动计时器。怪物、跌落伤害和岩浆不会。失去连接等同于退出。
这是第二种情况,即没有人杀死假人模型:

禁止通过传送逃离战斗
当玩家处于战斗状态时,/spawn、/home、/tp、/tpa、/warp 和 /back 命令将被禁用。你可以将自己的命令添加到列表中。

安装
- 你需要一个 Minecraft 26.3 的 Fabric 服务器,使用 Fabric Loader 0.20.1 或更高版本以及 Java 25。
- 将 Combat Persistence 和 Fabric API 放入
mods文件夹。 - 启动服务器一次。配置文件将在
config/combatpersistence.json处创建。
使用的是较旧的 Minecraft 版本?请查看 Versions 选项卡。每个文件仅适用于为其列出的版本。
大多数人会更改的设置
| 设置项 | 默认值 | 作用 |
|---|---|---|
combatTagDurationSeconds |
15 |
最后一次攻击后战斗持续的时长。 |
blockedCommands |
/spawn, /home, /tp, /tpa, /warp, /back |
战斗中无法使用的命令。添加你的服务器使用的别名。 |
combatMessage |
IN COMBAT: %s s remaining |
倒计时文本。 |
npcNamePrefix |
[OFFLINE] |
显示在假人模型名称之前。 |
npcDeathBroadcast |
[PvP] %s combat logged and was slain! |
假人模型死亡时的聊天消息。 |
disableEnderChests |
false |
关闭整个服务器的末影箱功能。 |
完整配置列表 位于 GitHub 上。
离线模式服务器
如果你的服务器以离线模式运行,内置了一个可选的登录系统:/register 和 /login、哈希密码、多次错误尝试后的锁定以及登录超时。在线模式服务器跳过所有这些步骤,因为 Mojang 已经验证了账户。
一个警告:离线模式不加密流量,因此任何能看到连接的人都可以读取密码。如果可以的话请使用在线模式,并告知玩家不要重复使用真实世界的密码。
常见问题
玩家需要安装这个模组吗? 不需要,只有服务器需要。
它能在 Paper、Spigot、Forge 或 NeoForge 上运行吗? 不能,它仅限 Fabric。
如果假人模型站在那里时服务器重启会发生什么? 假人模型会消失,但物品栏已保存到磁盘,所以玩家下次加入时会拿回物品。
它能与其他模组兼容吗? 原版物品栏、盔甲和副手物品都涵盖在内。我还没有测试过添加自己物品栏槽位的模组(如背包、饰品),所以请先在测试世界中尝试。
有什么它处理不了的情况吗? 如果假人模型死亡后世界保存前服务器崩溃,掉落的物品可能会丢失。更多详细信息请参阅 安全说明。
Bug 与支持
发现了 Bug?请在 Open an issue 中提供你的 Minecraft 版本、模组版本和服务器日志,我会查看一下。请先从日志中移除密码和 IP 地址。
如果这为你的服务器省去了一些麻烦,关注本项目会有帮助,并且在 Ko-fi 上请我喝杯咖啡也会有所帮助。
Combat Persistence
Someone is losing a fight, so they quit the game. On most servers that's the end of it: they're safe and they keep their stuff.
Not with this mod. If a player leaves while they're in combat, a copy of them stays behind for the rest of the combat timer, wearing their gear. Kill it and their items drop. When they log back in, they're dead.
It runs on the server only. Your players don't need to install anything.

How it works
- Hitting another player puts you both in combat for 15 seconds. The countdown shows above the hotbar. You can change the length in the config.
- If you log out during combat, an
[OFFLINE]mannequin with your gear stays where you were standing. - If someone kills the mannequin, your items drop and you die the next time you join.
- If nobody kills it before the timer runs out, it disappears and you get everything back when you log in.
- Only PvP starts the timer. Mobs, fall damage and lava don't. Losing connection counts the same as quitting.
Here's the second case, where nobody kills the mannequin:

No teleporting out of a fight
While a player is in combat, /spawn, /home, /tp, /tpa, /warp and /back are blocked. You can add your own commands to the list.

Installing
- You need a Fabric server on Minecraft 26.3, with Fabric Loader 0.20.1 or newer and Java 25.
- Drop Combat Persistence and Fabric API into the
modsfolder. - Start the server once. The config is created at
config/combatpersistence.json.
On an older Minecraft version? Check the Versions tab. Each file only works on the versions listed for it.
Settings most people change
| Setting | Default | What it does |
|---|---|---|
combatTagDurationSeconds |
15 |
How long combat lasts after the last hit. |
blockedCommands |
/spawn, /home, /tp, /tpa, /warp, /back |
Commands you can't use in combat. Add aliases your server uses. |
combatMessage |
IN COMBAT: %s s remaining |
The countdown text. |
npcNamePrefix |
[OFFLINE] |
Shown before the mannequin's name. |
npcDeathBroadcast |
[PvP] %s combat logged and was slain! |
Chat message when a mannequin dies. |
disableEnderChests |
false |
Turns off ender chests for the whole server. |
The full config list is on GitHub.
Offline-mode servers
If your server runs in offline mode, there's an optional login system built in: /register and /login, hashed passwords, a lockout after too many wrong attempts and a login timeout. Online-mode servers skip all of this because Mojang already checks accounts.
One warning: offline mode doesn't encrypt traffic, so passwords can be read by anyone who can see the connection. Use online mode if you can, and tell players not to reuse real passwords.
Questions
Do players need the mod? No, only the server does.
Does it work on Paper, Spigot, Forge or NeoForge? No, it's Fabric only.
What happens if the server restarts while a mannequin is standing there? The mannequin is gone, but the inventory is saved to disk, so the player gets it back the next time they join.
Does it work with other mods? Vanilla inventories, armor and the offhand are covered. I haven't tested mods that add their own inventory slots (backpacks, trinkets), so try it on a test world first.
Anything it can't handle? If the server crashes right after a mannequin dies, before the world saves, the dropped items can be lost. More detail is in the security notes.
Bugs and support
Found a bug? Open an issue with your Minecraft version, mod version and server log, and I'll take a look. Remove passwords and IP addresses from the log first.
If this saves your server some drama, following the project here helps, and so does a coffee on Ko-fi.
下载 Combat Persistence
下载 Combat Persistence
下载 Combat Persistence
下载 Combat Persistence
下载 Combat Persistence
下载 Combat Persistence
兼容性
- Minecraft 1.10.0 的 26.2 版本构建,包含与 26.3 版本相同的修复。基于 Fabric Loader 0.20.1 和 Fabric API 0.161.0+26.2 构建。
- 需要 Java 25 或更高版本。此构建仅支持 Minecraft 1.10.0 (26.2);如需支持 Minecraft 1.10.0 (26.3),请使用 26.3 版本的文件。
物品栏与恢复机制
- 在生成物品栏快照时排除合成结果预览,同时保留拥有的材料、鼠标悬停物品、装备及副手物品。
- 从原版合成、铁砧、锻造台、商人及其他临时菜单中捕获拥有物品的输入状态,而不复制结果预览或共享容器。
- 在断开连接的玩家物品栏清空前,完成持久的物品栏快照。
- 拒绝不完整的物品栏解码,避免用部分快照覆盖过期的物品栏数据。
- 当 NPC 创建或关键删除写入失败时,保留持久的恢复状态。
- 在消耗其恢复记录之前,先保存已恢复的玩家数据。
- 在释放掉落物之前,提交 NPC 死亡记录。
- 在支持的 POSIX 文件系统上使用序列化的原子文件替换机制,并传播写入失败错误,同时设置仅所有者权限。
- 若账户数据或恢复数据不可读,则拒绝启动,而不是静默丢弃这些数据。
认证与隐私
- 将身份认证绑定到当前连接,并在断开连接、账户重置或替换后拒绝过期的异步密码验证结果。
- 在原版替换现有连接之前,拒绝重复的 UUID 和不区分大小写的名称;在进入游戏前重新检查。
- 当相应设置启用时,在初始游戏数据包发送前隐藏物品栏、位置和最后死亡坐标。
- 保护额外的未认证数据包路径,包括移动和攻击路径,并重新检查队列中的命令。
- 允许玩家在死亡状态下重新连接后进行恢复和重生;在合法玩家死亡时清除战斗标签。
- 在监听器存在之前,不发送数据包即可清除早期登录的合成状态。
- 限制密码验证线程数量,限制失败尝试记录的数量,并限制皮肤请求队列的大小。
- 拒绝超过 BCrypt 72 字节 UTF-8 限制的密码。新配置要求至少八个字符。
- 默认禁用外部 Mojang 皮肤查找功能;需通过
enableSkinLookups显式启用。 - 当禁用 IP 自动登录时,避免存储登录 IP 地址。
- 当操作员重置无法持久化时,保持注册账户及其在线会话完整无损。
升级说明
升级前请一起备份世界/玩家数据以及所有认证/恢复文件。请确保备份文件私密安全。
外部自定义皮肤现在需要设置 enableSkinLookups=true;这将向 Mojang 披露请求的名称或 UUID 以及服务器 IP。现有的密码长度限制仍可按配置调整。受旧版 BCrypt 截断影响的账户可能需要由操作员协调进行重置。
建议优先使用在线模式(Online Mode)。本模组不会加密离线模式的密码流量。请保持 IP 自动登录禁用,并为现有的离线玩家安排首次注册。
恢复机制无法跨玩家文件、恢复文件和世界区块进行交易操作。崩溃仍可能导致掉落的掉落物丢失。自定义模组物品栏、代理设置和网络负载需要单独测试。有关验证范围和限制,请参阅 SECURITY_REVIEW.md。
参见
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
查看物品与配方
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
AE2:一款流行的自动化与存储模组
模组
那是什么?一个 Waila/Hwyla 的分支。
评论 0
登录后参与评分
还没有评论,来抢沙发吧