Skip to content

Fix reload crash when a player's tag has expired from cache#116

Open
pump61 wants to merge 1 commit into
Matt-MX:mainfrom
pump61:fix-reload-crash
Open

Fix reload crash when a player's tag has expired from cache#116
pump61 wants to merge 1 commit into
Matt-MX:mainfrom
pump61:fix-reload-crash

Conversation

@pump61

@pump61 pump61 commented Jul 16, 2026

Copy link
Copy Markdown

Summary

  • removeEntity() threw IllegalArgumentException whenever the entity wasn't present in nameTagEntityByEntityId (e.g. an AFK player whose tag had already expired via expireAfterAccess).
  • NameTagsCommand#reload() calls removeEntity() unconditionally for every online player, so hitting this on any single player aborted the reload loop midway, leaving everyone after them without a recreated tag until a full server restart. See Nametag dissapears and can't reload (1.21.7) #90.
  • Made removeEntity() idempotent: if there's nothing cached for the entity, it just returns null instead of throwing, matching the @Nullable contract it already declares.

Test plan

  • Reproduced on a live server (23+ online players) — /nametags reload reliably crashed and left tags broken until restart when an AFK player was in the loop.
  • Applied the fix, rebuilt, deployed — /nametags reload no longer throws and all tags are correctly recreated.

removeEntity() threw IllegalArgumentException whenever the entity
wasn't present in nameTagEntityByEntityId (e.g. an AFK player whose
tag expired via expireAfterAccess). NameTagsCommand#reload() calls
removeEntity() unconditionally for every online player, so hitting
this on any one player aborted the reload loop midway, leaving the
rest without a recreated tag until a full server restart.

Also repoints the entitylib dependency to its current coordinates
(io.github.tofaa2:spigot via maven.pvphub.me/tofaa) since the old
me.tofaa.entitylib snapshot host (maven.evokegames.gg) is offline,
which was blocking the build entirely.
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