Skip to content

Conversation

@onebeastchris
Copy link
Member

This resolves issues like #5413

Not an ideal fix as it'll hide most player list entries; hence why this should proooobably be a config option?

@onebeastchris onebeastchris marked this pull request as ready for review January 7, 2026 15:39
Copilot AI review requested due to automatic review settings January 7, 2026 15:39
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses a critical crash issue affecting PlayStation players when encountering servers with too many player list entries. The fix introduces a system property-based workaround that prevents player list entries from being sent to PlayStation clients when enabled.

Key changes:

  • Introduces a system property Geyser.NoPlayerListPs to enable player list limiting for PlayStation platforms
  • Adds conditional logic to skip adding player list entries for PS4 players when the property is enabled
  • Implements cleanup logic in PlayerEntity despawn to handle the limited entry scenario

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
PlayerListUtils.java Adds system property flag and utility method to check if player list entries should be limited for PlayStation platforms
JavaPlayerInfoUpdateTranslator.java Conditionally skips adding player list entries and waypoint cache updates when limiting is enabled
PlayerEntity.java Adds cleanup logic in despawnEntity to remove player list entries when limiting is active

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}
}

public static boolean shouldLimitPlayerlistEntries(GeyserSession session) {
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

The method name shouldLimitPlayerlistEntries has inconsistent capitalization in "Playerlist" (should be "PlayerList" with camel case). This inconsistency makes the API less discoverable and violates Java naming conventions.

Suggested change
public static boolean shouldLimitPlayerlistEntries(GeyserSession session) {
public static boolean shouldLimitPlayerListEntries(GeyserSession session) {

Copilot uses AI. Check for mistakes.
session.sendUpstreamPacket(unlistPacket);
}
}

Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

The new method shouldLimitPlayerlistEntries lacks documentation explaining its purpose, when it should be used, and the implications of limiting player list entries. This is particularly important given the PR description mentions this is "not an ideal fix" that hides most player list entries.

Suggested change
/**
* Returns whether the number of player list entries sent to the given session should be limited.
* <p>
* This is a compatibility workaround for PlayStation 4 clients: when the {@code Geyser.NoPlayerListPs}
* system property is enabled, most player list entries are hidden to avoid issues specific to that
* platform (for example, performance or stability problems when large player lists are shown).
* <p>
* Callers should check this method before sending large {@link PlayerListPacket} batches and reduce
* or skip entries when it returns {@code true}. Note that enabling this behavior means the in-game
* player list as seen by Bedrock players on PS4 will be incomplete or mostly hidden, and should be
* considered a non-ideal, temporary fix rather than the desired long-term behavior.
*
* @param session the session for which player list entries may be limited
* @return {@code true} if player list entries should be limited for this session, {@code false} otherwise
*/

Copilot uses AI. Check for mistakes.
import java.util.UUID;

public class PlayerListUtils {
private static final boolean HIDE_PLAYER_LIST_PS = Boolean.getBoolean("Geyser.NoPlayerListPs");
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

The system property name "Geyser.NoPlayerListPs" uses an abbreviation "Ps" which could be ambiguous. It's unclear whether this refers to "PlayStation", "PS4", or potentially "player list". A more explicit name like "Geyser.HidePlayerListForPlayStation" or "Geyser.LimitPlayerListForPS4" would improve clarity.

Suggested change
private static final boolean HIDE_PLAYER_LIST_PS = Boolean.getBoolean("Geyser.NoPlayerListPs");
// Prefer the clearer property name; keep the old one for backwards compatibility.
private static final boolean HIDE_PLAYER_LIST_PS =
Boolean.getBoolean("Geyser.HidePlayerListForPlayStation")
|| Boolean.getBoolean("Geyser.NoPlayerListPs");

Copilot uses AI. Check for mistakes.
Comment on lines +92 to +98
if (listed && PlayerListUtils.shouldLimitPlayerlistEntries(session)) {
PlayerListPacket packet = new PlayerListPacket();
packet.getEntries().add(new PlayerListPacket.Entry(getTabListUuid()));
packet.setAction(PlayerListPacket.Action.REMOVE);
session.sendUpstreamPacket(packet);
listed = false;
}
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

The cleanup logic in despawnEntity checks if listed is true and PlayerList entries should be limited, but this scenario should not occur. When shouldLimitPlayerlistEntries() is true, entries are never added to the player list in the first place (see JavaPlayerInfoUpdateTranslator.java line 114-118), so listed should remain false. This suggests a logic inconsistency - the entity's listed field is being set to true even when the entry is never added to the Bedrock player list, creating a mismatch between the field's value and actual state. This defensive check may be working around a state management issue that should be fixed at the source.

Copilot uses AI. Check for mistakes.
}

public static boolean shouldLimitPlayerlistEntries(GeyserSession session) {
return HIDE_PLAYER_LIST_PS && session.platform() == BedrockPlatform.PS4;
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

The check for limiting player list entries only considers PS4 platform, but PlayStation 5 (PS5) players may also experience the same crashing issue with too many player list entries. Consider whether PS5 should also be included in this platform check to provide consistent behavior across all PlayStation platforms.

Suggested change
return HIDE_PLAYER_LIST_PS && session.platform() == BedrockPlatform.PS4;
return HIDE_PLAYER_LIST_PS && (session.platform() == BedrockPlatform.PS4 || session.platform() == BedrockPlatform.PS5);

Copilot uses AI. Check for mistakes.
@MattDeWeerd
Copy link
Contributor

Hey @onebeastchris im currently experiencing this on my server. Any additional testing or info you need that I could provide for you?

@SleepyPopp
Copy link
Contributor

Feel free to try out this exact PR build of Geyser and give Chris feedback to work with.

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.

3 participants