KBControl (Paper)
KBControl 是一款轻量级的 PaperMC PvP 插件,用于控制战斗击退效果。
它会在受追踪实体受到伤害后不久拦截玩家收到的速度数据包,并独立缩放水平和垂直的击退分量,使其适用于
练习服务器、PvP 平衡调整以及自定义击退实验。
该插件可能与反作弊系统存在兼容性问题。请谨慎使用。
功能特性
- 分别调整水平击退(
X/Z)和垂直击退(Y)。
- 使用
/knockback 或其别名 /kb 来检查、更改或重载倍率。
- 将命令修改持久化保存至
config.yml。
- 利用短暂的玩家伤害标记过滤速度数据包。
依赖项
安装步骤
- 安装兼容的 Paper 服务器。
- 在同一服务器上安装 PacketEvents 插件。
- 构建或下载 KBControl/CustomKB JAR 文件。
- 将 JAR 文件放入服务器的
plugins/ 目录中。
- 启动服务器一次以生成默认的
plugins/CustomKB/config.yml。
- 编辑生成的配置文件,或在游戏/控制台使用
/kb set ...。
- 手动修改配置后,运行
/kb reload。
快速开始
/kb get
/kb set horizontal 0.9
/kb set vertical 1.05
/kb reload
默认值为中性倍率,因此在你设置其他值之前,原版/服务器的击退效果保持不变。
命令
所有命令均需权限 customkb.command.knockback。
| 命令 |
别名 |
参数 |
行为 |
/knockback get |
/kb get |
无 |
显示当前的水平和垂直倍率。 |
/knockback set horizontal <value> |
/kb set horizontal <value> |
value 为小数,>= 0.0 |
保存水平倍率。 |
/knockback set vertical <value> |
/kb set vertical <value> |
value 为小数,>= 0.0 |
保存垂直倍率。 |
/knockback reload |
/kb reload |
无 |
从 config.yml 重载数值。 |
当前源码中没有单独的 help 子命令。
权限
| 权限节点 |
默认分配 |
覆盖范围 |
customkb.command.knockback |
op |
访问所有 /knockback 和 /kb 子命令。 |
配置
生成的默认配置:
knockback:
# 应用于战斗击退水平(X/Z)分量的倍率。
horizontal-multiplier: 1.0
# 应用于战斗击退垂直(Y)分量的倍率。
vertical-multiplier: 1.0
实用的 PvP 示例:
knockback:
# 略微减少横向/向后移动。
horizontal-multiplier: 0.85
# 保持向上抬升接近默认值。
vertical-multiplier: 1.0
如何读取倍率数值:
1.0 保持该分量不变。
0.0 移除被处理战斗击退中的该分量。
0.5 将该分量减半。
2.0 将该分量加倍。
命令输入限制为 >= 0.0 的值。手动编辑的配置作为双精度浮点数加载,若缺失则回退默认为 1.0;当前源码在读取文件时不会添加额外的验证或截断处理。
击退控制原理
Minecraft 使用实体速度数据包来传递运动信息,包括战斗击退。KBControl 追踪未取消的
EntityDamageByEntityEvent 事件中的玩家受害者,保留该待处理的战斗击退标记
250 毫秒,并在玩家收到自身的 ENTITY_VELOCITY 数据包时消耗该标记。
当数据包匹配时,插件按以下方式重新缩放速度:
newX = oldX * horizontal-multiplier
newY = oldY * vertical-multiplier
newZ = oldZ * horizontal-multiplier
这使得水平和垂直调整相互独立,同时避免大多数非战斗相关速度变化受到影响。
行为与限制
- 仅追踪玩家受害者。
- 仅修改接收者自身实体的速度数据包。
- 待处理伤害标记仅被消耗一次,并在 250 毫秒后过期。
- 已取消的伤害事件将被忽略。
- 其他实体的速度数据包,或在 250 毫秒内没有待处理伤害标记的数据包,将被忽略。这是一种时间启发式方法:在此期间到达的不相关速度可能会被缩放并消耗掉标记。
- 其他修改伤害、速度、数据包或反作弊行为的插件可能会影响最终结果;请在你的完整服务器插件堆栈中进行测试。
- 当前源码声明的是 Paper API,而非 Spigot/Bukkit 兼容性。
使用示例
查看当前设置:
/kb get
使 PvP 击退更低更平:
/kb set horizontal 0.75
/kb set vertical 0.8
创建高抬升的练习击退,同时保持水平移动不变:
/kb set horizontal 1.0
/kb set vertical 1.4
手动编辑 config.yml 后:
/kb reload
KBControl (Paper)
KBControl is a small PaperMC PvP plugin for controlling combat knockback. It
intercepts player velocity packets received shortly after tracked entity damage and scales the
horizontal and vertical knockback components independently, making it useful for
practice servers, PvP balancing, and custom knockback experiments.
The plugin may have issues with anti-cheats. use with caution.
Features
- Adjust horizontal knockback (
X/Z) and vertical knockback (Y) separately.
- Use
/knockback or the /kb alias to inspect, change, or reload multipliers.
- Persist command changes back into
config.yml.
- Filter velocity packets using a short-lived player damage marker.
Dependencies
Installation
- Install a compatible Paper server.
- Install the PacketEvents plugin on the same server.
- Build or download the KBControl/CustomKB JAR.
- Place the JAR in your server
plugins/ directory.
- Start the server once to generate the default
plugins/CustomKB/config.yml.
- Edit the generated config or use
/kb set ... in game/console.
- Run
/kb reload after manual config changes.
Quick start
/kb get
/kb set horizontal 0.9
/kb set vertical 1.05
/kb reload
The defaults are neutral multipliers, so vanilla/server knockback is left
unchanged until you set a different value.
Commands
All commands require customkb.command.knockback.
| Command |
Alias |
Arguments |
Behavior |
/knockback get |
/kb get |
none |
Shows current horizontal and vertical multipliers. |
/knockback set horizontal <value> |
/kb set horizontal <value> |
value is a decimal number >= 0.0 |
Saves the horizontal multiplier. |
/knockback set vertical <value> |
/kb set vertical <value> |
value is a decimal number >= 0.0 |
Saves the vertical multiplier. |
/knockback reload |
/kb reload |
none |
Reloads values from config.yml. |
There is no separate help subcommand in the current source.
Permissions
| Permission |
Default |
Covers |
customkb.command.knockback |
op |
Access to every /knockback and /kb subcommand. |
Configuration
Generated default:
knockback:
# Multiplier applied to the horizontal (X/Z) component of combat knockback.
horizontal-multiplier: 1.0
# Multiplier applied to the vertical (Y) component of combat knockback.
vertical-multiplier: 1.0
Practical PvP example:
knockback:
# Slightly reduce sideways/backward movement.
horizontal-multiplier: 0.85
# Keep upward lift close to default.
vertical-multiplier: 1.0
How to read multiplier values:
1.0 keeps that component unchanged.
0.0 removes that component from handled combat knockback.
0.5 halves that component.
2.0 doubles that component.
Command input is limited to values >= 0.0. Manual config edits are loaded as
doubles with a fallback default of 1.0; the current source does not add extra
validation or clamping when reading the file.
How knockback control works
Minecraft uses entity velocity packets to communicate motion, including combat
knockback. KBControl tracks player victims of non-cancelled
EntityDamageByEntityEvent events, keeps that pending combat-knockback marker
for 250 milliseconds, and consumes it when the player receives their own
ENTITY_VELOCITY packet.
When the packet matches, the plugin rescales the velocity like this:
newX = oldX * horizontal-multiplier
newY = oldY * vertical-multiplier
newZ = oldZ * horizontal-multiplier
This keeps horizontal and vertical tuning independent while avoiding most
non-combat velocity changes.
Behavior and limitations
- Only player victims are tracked.
- Only velocity packets for the receiving player's own entity are modified.
- The pending damage marker is consumed once and expires after 250 ms.
- Cancelled damage events are ignored.
- Velocity packets for other entities, or without a pending damage marker within
250 ms, are ignored. This is a temporal heuristic: unrelated velocity arriving
during that window can be scaled and consume the marker.
- Other plugins that modify damage, velocity, packets, or anti-cheat behavior may
affect the final result; test with your full server plugin stack.
- The current source declares Paper APIs, not Spigot/Bukkit compatibility.
Usage examples
Show current settings:
/kb get
Make PvP knockback lower and flatter:
/kb set horizontal 0.75
/kb set vertical 0.8
Create high-lift practice knockback while leaving horizontal movement unchanged:
/kb set horizontal 1.0
/kb set vertical 1.4
After editing config.yml manually:
/kb reload
评论 0
登录后参与评分
还没有评论,来抢沙发吧