PlayerKickEvent.leaveMessage(Component leaveMessage) doesn't work with null.
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
The reporter traces the bug to the kick handling in paper-server/patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch, where a null leave message falls back to the default. Read the PlayerList#remove overloads and how PlayerQuitEvent supplies the final message, then reproduce with a plugin that calls leaveMessage(null) on PlayerKickEvent. Done means a null leave message suppresses the broadcast without breaking the quit event.
由索引模型根据 Issue 内容生成。
描述
Expected behavior
If I call PlayerKickEvent.leaveMessage(null), the leave message is set to null and so not sent, like it says in the description of the method.
Observed/Actual behavior
The leave message is still sent.
Steps/models to reproduce
@EventHandler
private void onPlayerKick(PlayerKickEvent event) {
event.leaveMessage(null);
}
- Log in with 2 accounts
- Kick one of them
- Observe leave message still being present
Plugin and Datapack List
Replicated with only my plugin.
Paper version
This server is running Paper version 26.3-237-main@7e88a0d (2026-11-01T19:08:12Z) (Implementing API version 26.3.build.237-stable)
You are running the latest version
Previous version: 26.3-236-f119026 (MC: 26.3)
Other
During my own analysis with the debugger and browing through source in intellij I came to the conclusion that it is caused by this line, which if the leave message is null, PlayerList#remove(net.minecraft.server.level.ServerPlayer) instead uses the default leave message. Then in PlayerList#remove(net.minecraft.server.level.ServerPlayer, net.kyori.adventure.text.Component) it calls PlayerQuitEvent with the supplied leave message, and uses the leave message out of that event, so using that event still works, but it's called later and doesn't have all the context.
- 主要语言
- Java
- 星标
- 12.8k
- 派生
- 3.6k
- 平均合并
- 2 天 21 小时
- 30 天内合并 PR
- 33
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
PaperMC/Paper 的其他 Issue
-
Add .getIgniter() to ExplosiveMinecart可能已有人在做 @WouterGritter 于 51 天前认领。 未关闭status: needs triage
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
BlockType#isOccluding is incorrectly handled可能已有人在做 @ryoji-ikeda 于 195 天前认领。 未关闭status: accepted
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
status: needs triage version: 26.3
难度 3/5 1-2 天 新手友好度 55/100
维护者通常 1 天内回复
-
status: needs triage version: 26.3
难度 4/5 3-5 天 新手友好度 48/100
维护者通常 1 天内回复
-
Baby foxes don't drop the item they are holding可能已有人在做 @personalized-advertising 于 5 天前认领。 未关闭status: accepted version: 26.3
难度 2/5 1-3 小时 新手友好度 25/100
维护者通常 1 天内回复
相似的 Issue
-
bug main ui
难度 2/5 1-3 小时 新手友好度 78/100
openhab/openhab-webui#4671 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 64/100
NearVanilla/IceCream#109 ·
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 88/100
omatheusmesmo/vintelli#293 ·
维护者通常 1 天内回复
-
getRawTextContent() returns the lines of every page in reverse order (bottom to top) since 4.0.3未关闭
难度 1/5 1-3 小时 新手友好度 90/100
-
难度 2/5 1-3 小时 新手友好度 82/100
bancolombia/bin-stash#79 ·