CartDebuffer
已在 Purpur 1.21.11 上测试。
预计兼容 Paper/Purpur 1.21–1.21.11。
该插件修改了玩家从 TNT 矿车 爆炸中受到的伤害。它允许你实时测试不同的伤害平衡方案,并在不重启服务器的情况下选择最佳方案。
1. 工作原理
插件监听带有 ENTITY_EXPLOSION(实体爆炸)或 BLOCK_EXPLOSION(方块爆炸)原因的 EntityDamageEvent 事件。为了确保伤害确实来自 TNT 矿车,而不是普通 TNT 或苦力怕的爆炸,它会通过 event.getDamageSource() 检查伤害来源。
如果你想完全禁用插件并恢复原版行为,只需在配置文件中设置 entity-damage.enabled: false 或运行 /cartdebuff toggle。
2. 伤害模式
使用以下命令切换模式:
/cartdebuff mode <mode>
multiplier - 简单倍率
final_damage = incoming_damage × multiplier
最简单的模式。它获取原版伤害值并按 multiplier(倍率)进行缩放。例如,multiplier: 0.5 会使伤害减半。
min-damage(最小伤害)和 max-damage(最大伤害)充当安全限制。
适用场景: 你喜欢原版的伤害行为(距离衰减、爆炸强度等),但希望按比例增强或削弱伤害的情况。
fixed - 固定伤害
每次 TNT 矿车爆炸造成的伤害始终为固定的 damage HP,不受距离、矿车数量、障碍物或其他任何因素的影响。
适用场景: 高度可预测的游戏玩法,例如 PvP 竞技场,其中伤害应始终保持一致。
distance-falloff - 随距离衰减的固定伤害
最先进且最准确的模式。伤害计算如下:
base-damage 用作爆炸中心的最大伤害。
- 随着玩家与爆炸源距离的增加,伤害按所选的
falloff-curve(衰减曲线)减少:
linear - 恒定递减;
quadratic - 在中距离衰减更快(默认);
exponential - 在近距离外迅速下降。
- 如果玩家与爆炸之间存在实心(不透明)方块,伤害会进一步降低。每个阻挡方块的伤害减少量为
damage-reduction-per-block(百分比)。这是通过光线追踪计算的(ExplosionMath.countObstructingBlocks)。
- 伤害永远不会低于
min-damage。
适用场景: 最真实且灵活模型。躲在墙后或较远的玩家受到的伤害将显著少于站在附近的玩家。
stepped-zones - 阶梯式距离区域
与平滑曲线不同,伤害被划分为固定的距离范围。如果玩家在 max-distance(最大距离)内,他们将获得相应的 damage(伤害)。区域按顺序检查,使用第一个匹配的区域。
zones:
- max-distance: 2.0 # 最多 2 个方块
damage: 12.0
- max-distance: 4.0 # 2 到 4 个方块之间
damage: 7.0
- max-distance: 6.0 # 4 到 6 个方块之间
damage: 3.0
- max-distance: 999.0 # 超出以上所有范围
damage: 0.0
适用场景: 简单的、可预测的平衡方案,无需复杂计算。
3. 通用设置 (settings)
| 设置项 |
描述 |
debug |
将每次伤害重新计算记录到控制台,包括原始值、新值、模式和距爆炸的距离 |
notify-admins-in-chat |
向拥有 cartdebuffer.admin 权限的玩家发送相同的信息 |
only-players |
true - 仅影响玩家;false - 生物也会受到影响 |
disabled-worlds |
插件不修改伤害的世界列表 |
4. 命令
| 命令 |
描述 |
/cartdebuff reload |
从磁盘重新加载 config.yml,无需重启服务器 |
/cartdebuff mode <mode> |
切换当前生效的伤害模式 |
/cartdebuff toggle |
启用或禁用所有伤害处理(恢复原版行为) |
/cartdebuff info |
显示当前激活的模式以及所有可用模式的列表 |
所有命令都需要 cartdebuffer.admin 权限(默认情况下,只有服务器操作员拥有此权限)。支持模式名称的 Tab 补全。
重要提示: mode 命令会立即将选定的模式保存到内存和 config.yml 中(调用 plugin.saveConfig()),因此选定的模式会在服务器重启后保持不变。
5. 寻找最佳模式(实用指南)
-
以 op(管理员)权限加入服务器。
-
逐一尝试每种模式:
/cartdebuff mode multiplier
/cartdebuff mode fixed
/cartdebuff mode distance-falloff
/cartdebuff mode stepped-zones
-
手动更改配置文件中的值(如 damage、multiplier 等)后,运行 /cartdebuff reload 来应用更改,而无需切换模式。
-
启用 settings.debug: true 并运行 /cartdebuff reload,以便在控制台中查看每次伤害重新计算的结果(旧值、新值、距离)。
-
一旦找到你喜欢的模式,只需将其保留在 config.yml 的 active-mode 中即可(或使用 mode 命令,它会自动保存)。
CartDebuffer
Tested on Purpur 1.21.11.
Expected to work on Paper/Purpur 1.21–1.21.11.
That plugin modifies the damage players receive
from TNT Minecart explosions. It allows you to test
different damage balancing approaches live and
choose the best one without restarting the server.
1. How It Works
The plugin listens for EntityDamageEvent events with the cause
ENTITY_EXPLOSION or BLOCK_EXPLOSION. To ensure that the damage comes
specifically from a TNT Minecart, rather than regular TNT or a
Creeper explosion, it checks the damage source through
event.getDamageSource().
If you want to disable the plugin completely and restore vanilla
behavior, simply set entity-damage.enabled: false in the configuration
or run /cartdebuff toggle.
2. Damage Modes
Switch modes with:
/cartdebuff mode <mode>
multiplier - Simple Multiplier
final_damage = incoming_damage × multiplier
The simplest mode. It takes the vanilla damage value and scales it by
multiplier. For example, multiplier: 0.5 halves the damage.
min-damage and max-damage act as safety limits.
Best for: situations where you like the vanilla damage behavior
(distance scaling, explosion strength, etc.) but simply want to make it
stronger or weaker proportionally.
fixed - Fixed Damage
Every TNT Minecart explosion always deals exactly damage HP,
regardless of distance, the number of minecarts, obstacles, or any other
factors.
Best for: highly predictable gameplay, such as PvP arenas where
damage should always remain the same.
distance-falloff - Fixed Damage with Distance Falloff
The most advanced and accurate mode. Damage is calculated as follows:
base-damage is used as the maximum damage at the explosion center.
- Damage decreases with the player's distance from the explosion using
the selected
falloff-curve:
linear - constant decrease;
quadratic - falls off more rapidly at medium distances (default);
exponential - drops very quickly immediately outside the close
range.
- Damage is further reduced if solid (opaque) blocks are located
between the player and the explosion. Each blocking block reduces the
damage by
damage-reduction-per-block (percentage). This is
calculated using ray tracing
(ExplosionMath.countObstructingBlocks).
- Damage will never drop below
min-damage.
Best for: the most realistic and flexible model. Players behind
walls or farther away receive significantly less damage than those
standing nearby.
stepped-zones - Stepped Distance Zones
Instead of a smooth curve, damage is divided into fixed distance ranges.
If the player is within max-distance, they receive the corresponding
damage. Zones are checked in order, and the first matching zone is
used.
zones:
- max-distance: 2.0 # up to 2 blocks
damage: 12.0
- max-distance: 4.0 # from 2 to 4 blocks
damage: 7.0
- max-distance: 6.0 # from 4 to 6 blocks
damage: 3.0
- max-distance: 999.0 # everything beyond
damage: 0.0
Best for: simple, predictable balancing without complex calculations.
3. General Settings (settings)
| Setting |
Description |
debug |
Logs every damage recalculation to the console, including the original value, new value, mode, and distance from the explosion |
notify-admins-in-chat |
Sends the same information to players with the cartdebuffer.admin permission |
only-players |
true - only players are affected; false - mobs are affected as well |
disabled-worlds |
List of worlds where the plugin does not modify damage |
4. Commands
| Command |
Description |
/cartdebuff reload |
Reloads config.yml from disk without restarting the server |
/cartdebuff mode <mode> |
Switches the active damage mode |
/cartdebuff toggle |
Enables or disables all damage processing (restores vanilla behavior) |
/cartdebuff info |
Displays the currently active mode and a list of all available modes |
All commands require the cartdebuffer.admin permission (by default,
only server operators have it). Tab completion is supported for mode
names.
Important: the mode command immediately saves the selected mode
both in memory and in config.yml (plugin.saveConfig()), so the
selected mode persists across server restarts.
5. Finding the Best Mode (Practical Guide)
-
Join the server with op permissions.
-
Try each mode one by one:
/cartdebuff mode multiplier
/cartdebuff mode fixed
/cartdebuff mode distance-falloff
/cartdebuff mode stepped-zones
-
After manually changing values in the configuration (damage,
multiplier, etc.), run /cartdebuff reload to apply the changes
without switching modes.
-
Enable settings.debug: true and run /cartdebuff reload to see
every damage recalculation in the console (old value, new value,
distance).
-
Once you've found the mode you like, simply leave it as
active-mode in config.yml (or use the mode command, which saves
it automatically).
评论 0
登录后参与评分
还没有评论,来抢沙发吧