Skip to content

Fix beacons disconnecting players when the beam is obstructed - #6611

Merged
Novampr merged 2 commits into
GeyserMC:masterfrom
HyacinthHaru:fix/beacon-invalid-effects
Sep 23, 2026
Merged

Novampr merged 2 commits into
GeyserMC:masterfrom
HyacinthHaru:fix/beacon-invalid-effects

Conversation

@HyacinthHaru

Copy link
Copy Markdown
Contributor

Closes #6603 #6559

Symptom

Since Java 26.2, Bedrock players get kicked after pressing confirm while interacting with the beacon UI. The server only logs a single line: Player <name> tried to set invalid beacon effects, with no stack trace. After relogging, the beacon's state is unchanged.

Cause

The two sides disagree on what the "beacon level" is, and Geyser forwards the Bedrock client's selection as-is. The Bedrock client counts the pyramid itself to compute the level and lights up the effect buttons accordingly. Java's BeaconBlockEntity#levels, however, is only recalculated while the beam reaches the sky — once the beam is obstructed, beamSections gets cleared and levels freezes at its last value, so a beacon that has never had a clear beam stays at level 0 forever. Geyser does receive the level Java reports (container property key 0), but was previously discarding it outright. As a result, Bedrock shows level 2 and allows selecting the Jump Boost upgrade, while Java still thinks the level is 0, so validateEffects flags it as invalid.

Also see #6603

Fix

Added a levels field to BeaconContainer; case 0 in updateProperty now records this value; translateSpecialRequest validates the request against the same rules as BeaconBlockEntity#validateEffects before forwarding it, and calls rejectRequest(request, false) if validation fails.

Fix Result

Paper 26.2-111, Geyser-Spigot + Floodgate only.

Before the fix, the crash still occurred whenever there was a block above the beacon beam. After the fix, the request is rejected locally without kicking the player, the beacon only becomes interactable again once the obstruction is removed.

This PR used Claude Code to locate the issue, identify the API changes introduced in the version update, implement the fix. I am a human and this PR tested by myself.

Java stops updating the beacon's level while the beam is blocked, so Bedrock could ask for effects it rejects.
Copilot AI lite review requested due to automatic review settings August 10, 2026 02:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 Bedrock players being disconnected when confirming beacon effects while the beacon beam is obstructed, by validating the Bedrock-selected effects against the beacon level that Java reports before forwarding the request downstream.

Changes:

  • Track the Java-reported beacon levels value on BeaconContainer (container property key 0).
  • Add effect/level validation in BeaconInventoryTranslator#translateSpecialRequest to locally reject invalid selections instead of forwarding them and triggering a disconnect.
  • Introduce a mapping of beacon effects to required beacon levels to mirror Java’s validation rules.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
core/src/main/java/org/geysermc/geyser/translator/inventory/BeaconInventoryTranslator.java Records Java beacon level and validates primary/secondary effect requests before sending ServerboundSetBeaconPacket.
core/src/main/java/org/geysermc/geyser/inventory/BeaconContainer.java Adds a levels field to store the Java-reported beacon level.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

OptionalInt primary = toJava(beaconPayment.getPrimaryEffect());
OptionalInt secondary = toJava(beaconPayment.getSecondaryEffect());
if (!validEffects(primary, secondary, container.getLevels())) {
// Java stops updating the level while the beam is obstructed, so Bedrock can offer effects

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder if this is something we could also patch in the integrated pack (Making the option impossible to pick), for now I agree this fix will work good enough

@Novampr
Novampr merged commit 54250f1 into GeyserMC:master Sep 23, 2026
2 checks passed
vtremblay pushed a commit to vtremblay/Geyser that referenced this pull request Sep 23, 2026
…MC#6611)

Java stops updating the beacon's level while the beam is blocked, so Bedrock could ask for effects it rejects.

Co-authored-by: Auri <auroranova8756@gmail.com>
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.

Bedrock client is disconnected when using a beacon whose beam is obstructed

4 participants