Skip to content

Fix PlayerRadarHud null crash when switching servers#6455

Open
Frko5000 wants to merge 1 commit into
MeteorDevelopment:masterfrom
Frko5000:fix/player-radar-null-crash-clean
Open

Fix PlayerRadarHud null crash when switching servers#6455
Frko5000 wants to merge 1 commit into
MeteorDevelopment:masterfrom
Frko5000:fix/player-radar-null-crash-clean

Conversation

@Frko5000
Copy link
Copy Markdown

@Frko5000 Frko5000 commented Jun 7, 2026

Type of change

  • Bug fix
  • New feature

Description

PlayerRadarHud was crashing when switching servers on a hub network. During a server switch, Minecraft starts clearing the current world and entities become null. The HUD was still rendering and trying to call .position() on null entities, causing a NullPointerException. Fixed by adding a null check to filter out null entities and a null camera entity before sorting.

Related issues

Fixes #6433

How Has This Been Tested?

Tested by switching servers on a hub network with PlayerRadarHud enabled. The crash no longer occurs.

Checklist:

  • My code follows the style guidelines of this project.
  • I have added comments to my code in more complex areas.
  • I have tested the code in both development and production environments.

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.

[Bug] PlayerRadarHud causes crash

1 participant