LimitedGrace
一款适用于 Paper 服务器的轻量级且可配置的死亡保护插件。
LimitedGrace 为玩家提供有限数量的受保护死亡次数,在这些次数内,玩家保留其物品栏和经验值。
它旨在让那些希望降低游戏初期意外惩罚性、同时又不永久移除死亡后果的生存服务器受益。
v1.4.0 新增: LimitedGrace 现在会检测玩家所在世界中的 keepInventory 游戏规则。默认情况下,当游戏规则已经保留玩家物品时,死亡不会消耗 LimitedGrace 的保护次数。此行为可在 config.yml 中更改。
✨ 功能特性
-
有限的死亡保护
在保护生效期间,玩家保留其物品栏和经验值。
-
双重保护层级
结合自动计算的新手保护与管理员授予的额外保护。
-
感知 keepInventory 的次数处理
当世界的 keepInventory 游戏规则已经保留玩家物品时,避免消耗 LimitedGrace 次数。服务器管理员可以配置此行为。
-
个人保护控制
玩家可以使用 /lg switch 自行启用或禁用自己的保护。
-
全局保护控制
管理员可以全局启用或禁用死亡保护。
-
额外保护管理
可以添加或设置额外次数,而无需修改玩家的实际死亡计数。
-
无限保护权限
选定的玩家可以获得死亡保护而不消耗次数。
-
低次数警告
当玩家的剩余保护次数达到配置阈值时,玩家可以收到通知。
-
自定义消息
命令提示、警告和管理消息可以在 config.yml 中进行更改。
-
持久化玩家数据
死亡计数、额外次数和个人保护状态均与玩家一起存储。无需数据库。
-
异步更新检查
LimitedGrace 可以检查 GitHub Releases 以获取新版本,而不会阻塞服务器线程。它仅显示控制台通知,绝不会自动下载更新。
-
无依赖项要求
安装插件并启动服务器即可——无需其他插件或数据库。
? 安装步骤
- 下载最新的 LimitedGrace
.jar 文件。
- 停止你的服务器。
- 将文件放入服务器的
plugins 目录中。
- 启动服务器。
- 如有需要,编辑
plugins/LimitedGrace/config.yml。
- 更改配置后运行
/lg reload。
LimitedGrace 将在首次启动时自动生成其配置文件。
?️ 工作原理
每位玩家可以从两个来源获得保护:
新手保护 (Newbie Protection)
新手保护是根据配置的保护上限和玩家的死亡计数计算得出的。
使用默认配置,前 10 次死亡 受到保护。
额外保护 (Extra Protection)
额外保护次数由管理员授予。它们在玩家的新手保护耗尽后被使用。
玩家的总剩余保护次数计算如下:
剩余保护 = 新手保护 + 额外保护
当应用死亡保护时:
- 保留物品栏物品。
- 保留经验值和等级。
- 消耗一次适用的保护次数。
- 当剩余次数达到配置的阈值时,可能会显示警告。
在以下情况下不应用保护:
- 全局死亡保护已禁用。
- 玩家禁用了自己的个人保护。
- 玩家没有剩余的保护次数。
拥有 limitedgrace.unlimited 权限的玩家将获得保护,且不消耗新手或额外保护次数。
拥有 limitedgrace.unlimited 权限的玩家仍受全局和个人保护开关的限制。如果任一开关被禁用,死亡保护将不会应用。
keepInventory 行为
LimitedGrace 会检查玩家死亡所在世界中的 keepInventory 游戏规则。
keepinventory-consumes-charge: false
false (默认) — 当 keepInventory 启用时,LimitedGrace 不会消耗保护次数。物品和经验的保留由游戏规则处理。
true — LimitedGrace 正常处理死亡,即使启用了 keepInventory,也会消耗一次适用的保护次数。
由于 keepInventory 是按世界配置的,不同的世界可以在共享相同 LimitedGrace 设置的同时使用不同的游戏规则状态。
? 命令
主命令为 /limitedgrace。所有命令也可以使用较短的 /lg 别名。
用 < > 括起来的参数是必需的。用 [ ] 括起来的参数是可选的。
| 命令 |
描述 |
权限 |
默认值 |
/limitedgrace help |
显示命令帮助 |
None |
Everyone |
/limitedgrace get |
查看你剩余的防护次数 |
limitedgrace.get |
Everyone |
/limitedgrace get <player> |
查看其他玩家的防护次数 |
limitedgrace.get.it |
OP |
/limitedgrace getDeaths |
查看你当前的死亡次数 |
limitedgrace.get |
Everyone |
/limitedgrace getDeaths <player> |
查看其他玩家的死亡次数 |
limitedgrace.get.it |
OP |
/limitedgrace add <count> |
给自己增加额外的防护次数 |
limitedgrace.add |
OP |
/limitedgrace add <player> <count> |
给其他玩家增加额外的防护次数 |
limitedgrace.add |
OP |
/limitedgrace switch |
切换自己的死亡保护状态 |
limitedgrace.switch |
Everyone |
/limitedgrace switch <player> |
切换其他玩家的死亡保护状态 |
limitedgrace.switch.it |
OP |
/limitedgrace switchAll |
全局切换死亡保护状态 |
limitedgrace.switch.all |
OP |
/limitedgrace set <player> <count> |
设置某玩家的额外防护次数 |
limitedgrace.set |
OP |
/limitedgrace setDeath <player> <count> |
设置某玩家的实际死亡次数 |
limitedgrace.setdeath |
OP |
/limitedgrace reload |
重新加载插件配置 |
limitedgrace.reload |
OP |
针对其他玩家的命令要求该玩家必须在线。
? 权限
| 权限 |
描述 |
默认值 |
limitedgrace.admin |
LimitedGrace 管理员权限 |
OP |
limitedgrace.unlimited |
在使用死亡保护时不消耗次数 |
False |
limitedgrace.reload |
允许重新加载配置 |
OP |
limitedgrace.set |
允许设置额外防护次数 |
OP |
limitedgrace.setdeath |
允许设置实际死亡次数 |
OP |
limitedgrace.get |
允许玩家查看自己的防护信息 |
Everyone |
limitedgrace.get.it |
允许查看其他玩家的防护信息 |
OP |
limitedgrace.add |
允许添加额外防护次数 |
OP |
limitedgrace.switch |
允许玩家切换自己的死亡保护状态 |
Everyone |
limitedgrace.switch.it |
允许切换其他玩家的死亡保护状态 |
OP |
limitedgrace.switch.all |
允许全局启用或禁用死亡保护 |
OP |
limitedgrace.unlimited 默认为 false。服务器操作员不会自动获得此权限。请使用 LuckPerms 等权限插件显式授予。
示例:
/lp user <player> permission set limitedgrace.unlimited true
⚙️ 配置
配置文件位于:
plugins/LimitedGrace/config.yml
主要设置
| 设置项 |
描述 |
默认值 |
enabled |
全局死亡保护状态 |
true |
update-check.enabled |
在插件启动时检查 GitHub Releases |
true |
keepinventory-consumes-charge |
当启用 keepInventory 时消耗一次防护次数 |
false |
death-protections-number |
新手保护次数 |
10 |
default-added-protections-number |
分配给玩家的默认额外次数 |
0 |
protect-warn |
触发警告的剩余次数阈值 |
3, 1 |
消息支持使用 § 的 Minecraft 传统颜色代码。
根据具体消息,动态值使用 {0}、{1}、%s 或 %d。自定义消息时请保留默认消息中使用的占位符类型。
配置示例
# 全局死亡保护状态。
# 使用 `/lg switchAll` 进行切换。
enabled: true
# 在启动时检查 GitHub Releases 以获取新版本的插件。
update-check:
enabled: true
# 启用 `keepInventory` 游戏规则的死亡是否消耗防护次数。
keepinventory-consumes-charge: false
# 防护次数。
death-protections-number: 10
default-added-protections-number: 0
# 玩家收到警告时的剩余防护次数。
protect-warn:
- 3
- 1
# 消息支持使用 `§` 的 Minecraft 颜色代码。
# 动态值使用如 {0}、{1}、%s 和 %d 等占位符。
help-message:
- "§6§lLimitedGrace 帮助"
- "§e/lg help §7- 显示插件帮助"
- "§e/lg switch [player] §7- 为自己或其他玩家切换保护"
- "§e/lg switchAll §7- 全局切换保护"
- "§e/lg get [player] §7- 查看剩余防护次数"
- "§e/lg getDeaths [player] §7- 查看死亡次数"
- "§e/lg set [player] <count> §7- 设置额外防护次数"
- "§e/lg setDeath [player] <count> §7- 设置死亡次数"
- "§e/lg add [player] <count> §7- 添加额外防护次数"
- "§e/lg reload §7- 重新加载插件配置"
protect-message: "§a玩家 §f{0} §a拥有 §e{1} §a个死亡防护次数§f。\n§a其中包括 §e{2} §a个新手防护次数 §f和 §e{3} §a个额外防护次数§f。"
protect-warn-message: "§a您仅剩 §e{0} §a个死亡防护次数§f。\n§a剩余新手防护次数:§e{1}§f;§a剩余额外防护次数:§e{2}§f。"
death-message: "§a玩家 §f{0} §a已死亡 §e{1} §a次。"
not-permission-message: "§c您没有权限使用此命令!"
reload-message: "§a配置重新加载成功!"
set-player-death-message: "§a已将玩家 §f%s§a 的死亡次数设置为 §e%d§a。"
set-player-added-permission-message: "§a已将玩家 §f%s§a 的额外防护次数设置为 §e%d§a。"
player-404-message: "§c玩家不存在或未在线。"
value-err-message: "§c无效的值。"
set-added-protect-message: "§a已将玩家 §f{0}§a 的额外防护次数设置为 §e{1}§a。"
integer-error-message: "§c{0} 不是有效的整数。"
value-unchanged-message: "§c数值未发生变化。"
death-update-error-message: "§c更新玩家死亡计数失败。"
protection-update-error-message: "§c更新玩家额外保护次数失败。"
switch-self-message: "你的死亡保护状态已更改为 {0}。"
switch-player-message: "{0} 的死亡保护状态已更改为 {1}。"
switch-all-message: "全局死亡保护状态已更改为 {0}。"
编辑配置后,请使用以下命令应用更改:
/lg reload
禁用更新检查
更新检查器仅从 GitHub 请求发布信息,并在服务器控制台中报告可用版本。它不会下载或替换插件文件。
要禁用它:
update-check:
enabled: false
? 依赖要求
| 组件 |
要求 |
| Minecraft |
1.19.4 或更高版本 |
| 服务端软件 |
Paper 1.19.4 或更高版本 |
| Java |
Java 17 或更高版本 |
| 依赖项 |
无 |
LimitedGrace 针对 Paper 优化。不保证与未列出的 Bukkit 衍生服务端软件的兼容性。
⬆️ 从旧版本升级
在更新之前:
- 停止服务器。
- 备份
plugins/LimitedGrace/config.yml。
- 替换旧的 LimitedGrace
.jar 文件。
- 启动服务器。
当升级到 v1.4.0 时,请在现有的 config.yml 中添加以下选项:
# 启用 `keepInventory` 游戏规则时的死亡是否消耗一次保护次数。
keepinventory-consumes-charge: false
或者,备份并删除旧的 config.yml,然后重启服务器以生成最新配置。
玩家保护数据存储在 config.yml 之外,重新生成配置时不会被移除。
❓ 常见问题
LimitedGrace 会永久启用 keepInventory 吗?
不会。物品和经验保留仅在玩家的 LimitedGrace 保护激活时生效。该插件不会更改世界的 keepInventory 游戏规则。
如果世界已经启用了 keepInventory 会发生什么?
默认情况下,由于游戏规则已经保留了玩家的物品,LimitedGrace 会跳过消耗次数。如果希望这些死亡正常处理并消耗适用的 LimitedGrace 次数,请将 keepinventory-consumes-charge 设置为 true。
禁用个人保护是否会消耗次数?
不会。当个人保护被禁用时,玩家会正常死亡,且不会使用 LimitedGrace 保护次数。
服务器管理员是否自动获得无限保护?
不会。limitedgrace.unlimited 默认为 false,必须显式授予。
更新检查器会自动安装更新吗?
不会。它仅检查 GitHub Releases 并在服务器控制台中打印通知。
需要数据库吗?
不需要。LimitedGrace 通过 Minecraft 的持久化玩家数据存储系统存储其玩家数据。
? 链接
LimitedGrace 提供了一种简单且对性能友好的方式,以减轻早期游戏阶段的死亡惩罚,同时保持长期生存的挑战性。
LimitedGrace
A lightweight and configurable death protection plugin for Paper servers.
LimitedGrace gives players a limited number of protected deaths during which they keep their inventory and experience.
It is designed for survival servers that want to make early-game accidents less punishing without permanently removing the consequences of death.
New in v1.4.0: LimitedGrace now detects the keepInventory game rule in the player's world. By default, deaths do not consume LimitedGrace protection charges when the game rule already preserves the player's inventory. This behavior can be changed in config.yml.
✨ Features
-
Limited death protection
Players keep their inventory and experience while protection is active.
-
Two protection layers
Combines automatically calculated newbie protection with administrator-granted extra protection.
-
keepInventory-aware charge handling
Avoids consuming LimitedGrace charges when the world's keepInventory game rule already preserves the player's inventory. Server administrators can configure this behavior.
-
Personal protection control
Players can enable or disable their own protection using /lg switch.
-
Global protection control
Administrators can enable or disable death protection server-wide.
-
Extra protection management
Extra charges can be added or set without modifying the player's actual death count.
-
Unlimited protection permission
Selected players can receive death protection without consuming charges.
-
Low-charge warnings
Players can be notified when their remaining protection reaches configured thresholds.
-
Customizable messages
Commands, warnings, and administrative messages can be changed in config.yml.
-
Persistent player data
Death counts, extra charges, and personal protection states are stored with the player. No database is required.
-
Asynchronous update checking
LimitedGrace can check GitHub Releases for new versions without blocking the server thread. It only displays a console notification and never downloads updates automatically.
-
No required dependencies
Install the plugin and start the server—no additional plugins or databases are required.
? Installation
- Download the latest LimitedGrace
.jar.
- Stop your server.
- Place the file in the server's
plugins directory.
- Start the server.
- Edit
plugins/LimitedGrace/config.yml if needed.
- Run
/lg reload after changing the configuration.
LimitedGrace will generate its configuration automatically on the first startup.
?️ How It Works
Each player can receive protection from two sources:
Newbie Protection
Newbie protection is calculated from the configured protection limit and the player's death count.
With the default configuration, the first 10 deaths are protected.
Extra Protection
Extra protection charges are granted by administrators. They are used after the player's newbie protection has been exhausted.
A player's total remaining protection is calculated as:
Remaining protection = Newbie protection + Extra protection
When death protection is applied:
- Inventory items are kept.
- Experience and levels are kept.
- One applicable protection charge is consumed.
- A warning may be displayed when the remaining charge count reaches a configured threshold.
Protection is not applied when:
- Global death protection is disabled.
- The player has disabled their personal protection.
- The player has no remaining protection charges.
Players with limitedgrace.unlimited receive protection without consuming newbie or extra protection charges.
Players with limitedgrace.unlimited are still subject to the global and personal protection switches. If either switch is disabled, death protection will not be applied.
keepInventory Behavior
LimitedGrace checks the keepInventory game rule in the world where the player dies.
keepinventory-consumes-charge: false
false (default) — LimitedGrace does not consume a protection charge when keepInventory is enabled. Inventory and experience retention are handled by the game rule.
true — LimitedGrace processes the death normally, and an applicable protection charge is consumed even when keepInventory is enabled.
Because keepInventory is configured per world, different worlds can use different game-rule states while sharing the same LimitedGrace setting.
? Commands
The main command is /limitedgrace. All commands can also use the shorter /lg alias.
Arguments enclosed in < > are required. Arguments enclosed in [ ] are optional.
| Command |
Description |
Permission |
Default |
/limitedgrace help |
Show the command help |
None |
Everyone |
/limitedgrace get |
View your remaining protection charges |
limitedgrace.get |
Everyone |
/limitedgrace get <player> |
View another player's protection charges |
limitedgrace.get.it |
OP |
/limitedgrace getDeaths |
View your current death count |
limitedgrace.get |
Everyone |
/limitedgrace getDeaths <player> |
View another player's death count |
limitedgrace.get.it |
OP |
/limitedgrace add <count> |
Add extra protection charges to yourself |
limitedgrace.add |
OP |
/limitedgrace add <player> <count> |
Add extra protection charges to another player |
limitedgrace.add |
OP |
/limitedgrace switch |
Toggle your own death protection |
limitedgrace.switch |
Everyone |
/limitedgrace switch <player> |
Toggle another player's death protection |
limitedgrace.switch.it |
OP |
/limitedgrace switchAll |
Toggle death protection globally |
limitedgrace.switch.all |
OP |
/limitedgrace set <player> <count> |
Set a player's extra protection charges |
limitedgrace.set |
OP |
/limitedgrace setDeath <player> <count> |
Set a player's actual death count |
limitedgrace.setdeath |
OP |
/limitedgrace reload |
Reload the plugin configuration |
limitedgrace.reload |
OP |
Commands targeting another player currently require that player to be online.
? Permissions
| Permission |
Description |
Default |
limitedgrace.admin |
LimitedGrace administrator permission |
OP |
limitedgrace.unlimited |
Prevents charges from being consumed when death protection is used |
False |
limitedgrace.reload |
Allows the configuration to be reloaded |
OP |
limitedgrace.set |
Allows extra protection charges to be set |
OP |
limitedgrace.setdeath |
Allows actual death counts to be set |
OP |
limitedgrace.get |
Allows players to view their own protection information |
Everyone |
limitedgrace.get.it |
Allows another player's protection information to be viewed |
OP |
limitedgrace.add |
Allows extra protection charges to be added |
OP |
limitedgrace.switch |
Allows players to toggle their own death protection |
Everyone |
limitedgrace.switch.it |
Allows another player's protection state to be toggled |
OP |
limitedgrace.switch.all |
Allows death protection to be enabled or disabled globally |
OP |
limitedgrace.unlimited defaults to false. Server operators do not receive it automatically. Grant it explicitly with a permissions plugin such as LuckPerms.
Example:
/lp user <player> permission set limitedgrace.unlimited true
⚙️ Configuration
The configuration is located at:
plugins/LimitedGrace/config.yml
Main Settings
| Setting |
Description |
Default |
enabled |
Global death protection state |
true |
update-check.enabled |
Check GitHub Releases when the plugin starts |
true |
keepinventory-consumes-charge |
Consume a protection charge when keepInventory is enabled |
false |
death-protections-number |
Number of newbie protection charges |
10 |
default-added-protections-number |
Default extra charges assigned to players |
0 |
protect-warn |
Remaining charge counts that trigger a warning |
3, 1 |
Messages support Minecraft legacy color codes using §.
Depending on the message, dynamic values use {0}, {1}, %s, or %d. Keep the placeholder type used by the default message when customizing it.
Configuration Example
# Global death protection state.
# Use `/lg switchAll` to toggle it.
enabled: true
# Check GitHub Releases for a newer plugin version on startup.
update-check:
enabled: true
# Whether deaths with the `keepInventory` game rule enabled consume a protection charge.
keepinventory-consumes-charge: false
# Number of protection charges.
death-protections-number: 10
default-added-protections-number: 0
# Remaining protection counts at which the player will receive a warning.
protect-warn:
- 3
- 1
# Messages support Minecraft color codes using `§`.
# Dynamic values use placeholders such as {0}, {1}, %s, and %d.
help-message:
- "§6§lLimitedGrace Help"
- "§e/lg help §7- Show plugin help"
- "§e/lg switch [player] §7- Toggle protection for yourself or another player"
- "§e/lg switchAll §7- Toggle protection globally"
- "§e/lg get [player] §7- View remaining protection charges"
- "§e/lg getDeaths [player] §7- View the death count"
- "§e/lg set [player] <count> §7- Set extra protection charges"
- "§e/lg setDeath [player] <count> §7- Set the death count"
- "§e/lg add [player] <count> §7- Add extra protection charges"
- "§e/lg reload §7- Reload the plugin configuration"
protect-message: "§aPlayer §f{0} §ahas §e{1} §adeath protection charge(s)§f.\n§aThis includes §e{2} §anewbie protection charge(s) §fand §e{3} §aextra protection charge(s)§f."
protect-warn-message: "§aYou have only §e{0} §adeath protection charge(s) remaining§f.\n§aNewbie protection remaining: §e{1}§f; §aextra protection remaining: §e{2}§f."
death-message: "§aPlayer §f{0} §ahas died §e{1} §atime(s)."
not-permission-message: "§cYou do not have permission to use this command!"
reload-message: "§aConfiguration reloaded successfully!"
set-player-death-message: "§aSet player §f%s§a's death count to §e%d§a."
set-player-added-permission-message: "§aSet player §f%s§a's extra protection charges to §e%d§a."
player-404-message: "§cPlayer does not exist or is not online."
value-err-message: "§cInvalid value."
set-added-protect-message: "§aSet player §f{0}§a's extra protection charges to §e{1}§a."
integer-error-message: "§c{0} is not a valid integer."
value-unchanged-message: "§cThe value has not changed."
death-update-error-message: "§cFailed to update the player's death count."
protection-update-error-message: "§cFailed to update the player's extra protection charges."
switch-self-message: "Your death protection state has been changed to {0}."
switch-player-message: "{0}'s death protection state has been changed to {1}."
switch-all-message: "The global death protection state has been changed to {0}."
After editing the configuration, apply the changes with:
/lg reload
Disabling Update Checks
The update checker only requests release information from GitHub and reports available versions in the server console. It does not download or replace plugin files.
To disable it:
update-check:
enabled: false
? Requirements
| Component |
Requirement |
| Minecraft |
1.19.4 or newer |
| Server software |
Paper 1.19.4 or newer |
| Java |
Java 17 or newer |
| Dependencies |
None |
LimitedGrace targets Paper. Compatibility with unlisted Bukkit-derived server software is not guaranteed.
⬆️ Updating from an Older Version
Before updating:
- Stop the server.
- Back up
plugins/LimitedGrace/config.yml.
- Replace the old LimitedGrace
.jar.
- Start the server.
When updating to v1.4.0, add the following option to your existing config.yml:
# Whether deaths with the `keepInventory` game rule enabled consume a protection charge.
keepinventory-consumes-charge: false
Alternatively, back up and delete the old config.yml, then restart the server to generate the latest configuration.
Player protection data is stored separately from config.yml and is not removed when the configuration is regenerated.
❓ Frequently Asked Questions
Does LimitedGrace permanently enable keepInventory?
No. Inventory and experience retention are applied only when a player's LimitedGrace protection is active. The plugin does not change the world's keepInventory game rule.
What happens when a world already has keepInventory enabled?
By default, LimitedGrace skips charge consumption because the game rule already preserves the player's inventory. Set keepinventory-consumes-charge to true if these deaths should be processed normally and consume applicable LimitedGrace charges.
Does disabling personal protection consume charges?
No. When personal protection is disabled, the player dies normally and LimitedGrace protection charges are not used.
Do server operators automatically receive unlimited protection?
No. limitedgrace.unlimited defaults to false and must be granted explicitly.
Does the update checker automatically install updates?
No. It only checks GitHub Releases and prints a notification in the server console.
Is a database required?
No. LimitedGrace stores its player data through Minecraft's persistent player data system.
? Links
LimitedGrace provides a simple and performance-friendly way to soften early-game death penalties while preserving the challenge of long-term survival.
评论 0
登录后参与评分
还没有评论,来抢沙发吧