Skip to content

Fix PlayerLinksSendEvent not firing when no global links are configured#14026

Merged
Warriorrrr merged 2 commits into
PaperMC:mainfrom
noctiro:fix/player-links-send-event-always-fire
Jul 26, 2026
Merged

Fix PlayerLinksSendEvent not firing when no global links are configured#14026
Warriorrrr merged 2 commits into
PaperMC:mainfrom
noctiro:fix/player-links-send-event-always-fire

Conversation

@noctiro

@noctiro noctiro commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Problem

PlayerLinksSendEvent is gated behind an isEmpty() check on the server's global ServerLinks. This means the event is never fired when no global links are configured, making it impossible for plugins to add per-player links from scratch without a workaround.

Plugins that want to show player-specific links (e.g. localized links based on client language) are currently forced to pre-populate the global ServerLinks with dummy entries just to make the event trigger — even though those global entries are irrelevant and must then be cleared inside the event handler.

Solution

Remove the isEmpty() guard before the event, and move it to after the event has been processed. The event now always fires, and the packet is only sent if the resulting ServerLinks is non-empty (either from global config or from plugin modifications).

@noctiro
noctiro requested a review from a team as a code owner July 3, 2026 03:33
@github-project-automation github-project-automation Bot moved this to Awaiting review in Paper PR Queue Jul 3, 2026
@Warriorrrr Warriorrrr added type: bug Something doesn't work as it was intended to. scope: api labels Jul 11, 2026
@Warriorrrr Warriorrrr moved this from Awaiting review to Delayed approval in Paper PR Queue Jul 17, 2026
@papermc-projects papermc-projects Bot moved this from Delayed approval to Full approval in Paper PR Queue Jul 26, 2026
@Warriorrrr
Warriorrrr merged commit ccee047 into PaperMC:main Jul 26, 2026
11 checks passed
@github-project-automation github-project-automation Bot moved this from Full approval to Merged in Paper PR Queue Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: api type: bug Something doesn't work as it was intended to.

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.

3 participants