Skip to content

fix: don't fire UserLoginEvent for players without a User (fake players) - #1627

Merged
AbhigyaKrishna merged 1 commit into
retrooper:2.0from
ShyyYuki:2.0
Nov 9, 2026
Merged

AbhigyaKrishna merged 1 commit into
retrooper:2.0from
ShyyYuki:2.0

Conversation

@ShyyYuki

@ShyyYuki ShyyYuki commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Fixes #1398

Problem

Plugins that spawn fake players via PlayerList#placeNewPlayer (e.g. Asteroid) cause Bukkit to fire a normal
PlayerJoinEvent. InternalGlobalBukkitListener#onPlayerJoin then resolves the User with
PlayerManager#getUser, which returns null for these players since they were never injected into a channel,
and fires UserLoginEvent with that null user anyway.

Listeners that expect a valid User (e.g. KnockbackSync) then fail with a NullPointerException.

Change

Skip firing UserLoginEvent when no User exists for the joining player.

Notes

Real players are unaffected, since they always have a User once their channel is injected.

@AbhigyaKrishna
AbhigyaKrishna merged commit d77f211 into retrooper:2.0 Nov 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fake players shouldn't fire UserJoinEvent like they're not injected into channels

2 participants