Skip to content

Fix Injector.getPlayer() using TemporaryPlayer when a Bukkit player is available#3614

Open
LeonTG wants to merge 1 commit intodmulloy2:masterfrom
LeonTG:temporary-player-fix
Open

Fix Injector.getPlayer() using TemporaryPlayer when a Bukkit player is available#3614
LeonTG wants to merge 1 commit intodmulloy2:masterfrom
LeonTG:temporary-player-fix

Conversation

@LeonTG
Copy link
Copy Markdown

@LeonTG LeonTG commented Apr 13, 2026

On my server I had a lot of issues where I was getting a temporary player for packets sent before PlayerJoinEvent, even tho Bukkit.getPlayerExact was returning the actual joined player

So I did some digging and I found out that even tho it returned the temporary player, playerName variable was set, and with more digging it turns out that even if a bukkit player is available, doing getPlayer on the injector would never check for Bukkit player if a temporary player was already assigned

so I decided to fix it myself, this is how I did it, and I figured I should make a PR for it, so others wont have this issue

@LeonTG
Copy link
Copy Markdown
Author

LeonTG commented Apr 13, 2026

For reference, this is what debugging I added

image

and it resulted in this

Found temporary player with name resolved... attempting to fix: kawaiibunri (Team: npcNameTag, Mode: 0, Class: com.comphenix.protocol.injector.temporary.TemporaryPlayerInvocationHandler)
Potential is: com.comphenix.protocol.injector.temporary.TemporaryPlayerInvocationHandler@55466d92
Temporary player is now: CraftPlayer{name=kawaiibunri} (Equal? false)

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.

1 participant