Skip to content

Fix newbie messages not firing for new players on modern Paper - #6571

Open
JRoy wants to merge 1 commit into
EssentialsX:2.xfrom
JRoy:fix/6466
Open

Fix newbie messages not firing for new players on modern Paper#6571
JRoy wants to merge 1 commit into
EssentialsX:2.xfrom
JRoy:fix/6466

Conversation

@JRoy

@JRoy JRoy commented Jun 14, 2026

Copy link
Copy Markdown
Member

Player#hasPlayedBefore() is unreliable since the switch to configuration-phase events, as player data is persisted during login, so genuine first-joiners were treated as returning players. This broke EssentialsSpawn newbie spawn/kit/announce-format (#6466).

Add a firstJoin flag to AsyncUserDataLoadEvent, derived from EssentialsX's own user data, and use it in EssentialsSpawn and EssentialsDiscord instead of hasPlayedBefore().

Fixes #6466

Player#hasPlayedBefore() is unreliable since the switch to
configuration-phase events, as player data is persisted during login, so
genuine first-joiners were treated as returning players. This broke
EssentialsSpawn newbie spawn/kit/announce-format (EssentialsX#6466).

Add a firstJoin flag to AsyncUserDataLoadEvent, derived from EssentialsX's
own user data, and use it in EssentialsSpawn and EssentialsDiscord instead
of hasPlayedBefore().

Fixes EssentialsX#6466
@mdcfe
mdcfe self-requested a review June 14, 2026 22:10

// A null last account name means EssentialsX has never recorded this player before, i.e. it's their first join.
// We rely on EssentialsX's own user data here rather than Player#hasPlayedBefore(), which is unreliable on modern
// server platforms that persist player data during the login/configuration phase (see GH-6466, GH-6464).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a link to the issues, not this Jira-esque syntax

pluginManager.registerEvent(PlayerJoinEvent.class, playerListener, joinPriority, (ll, event) ->
((EssentialsSpawnPlayerListener) ll).onPlayerJoin((PlayerJoinEvent) event), this);
// Listen on AsyncUserDataLoadEvent (fired after the core join flow) so we can reliably tell whether this is
// a player's first join, instead of using the unreliable Player#hasPlayedBefore() (see GH-6466).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto, also I'd rather we explained why hasPlayedBefore is "unreliable" inline

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.

EssX Newbie-join-msg not working

2 participants