PlayerKickEvent.leaveMessage(Component leaveMessage) doesn't work with null.
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
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時間
- マージ済み PR(30日)
- 33
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PaperMC/Paper のほかの issue
-
Add .getIgniter() to ExplosiveMinecart対応中かも @WouterGritter が 51 日前に担当しました。 オープンstatus: needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
PaperMC/Paper#14097 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
BlockType#isOccluding is incorrectly handled対応中かも @ryoji-ikeda が 195 日前に担当しました。 オープンstatus: accepted
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
PaperMC/Paper#13790 · コメント 5 件 ·
メンテナーはふだん 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
PaperMC/Paper#14453 · コメント 2 件 ·
メンテナーはふだん 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 ·