Skip to content

Fix spectator mode to match vanilla - #1471

Merged
TwistedAsylumMC merged 9 commits into
df-mc:masterfrom
MEMOxiiii:fix/spectator-mode
Oct 28, 2026
Merged

TwistedAsylumMC merged 9 commits into
df-mc:masterfrom
MEMOxiiii:fix/spectator-mode

Conversation

@MEMOxiiii

@MEMOxiiii MEMOxiiii commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Spectator mode in Dragonfly didn't behave like vanilla, so this PR fixes it to match BDS. I checked it against the decompiled server and tested it in game.

Before (Dragonfly)

Before.mp4

Vanilla

Vanilla.mp4

After (this PR)

After.mp4

Additional changes:

  • Switching to spectator while sleeping now wakes the player up.
  • Spectators are no longer counted when skipping the night, and the night is only skipped if at least one player is sleeping.
  • When no more players need to sleep, "Sleeping through this night" is shown instead of "0 more players need to sleep".

@tigerza117

Copy link
Copy Markdown

LGTM

@LucianoMejia

Copy link
Copy Markdown

LGTM!

@RestartFU

Copy link
Copy Markdown
Collaborator

The main spectator game-type/ability changes match the vanilla implementation I checked with lens-mcp, but two pre-existing spectator differences remain at a4754c1:

  1. Entering spectator does not cancel active item use or gliding. SetGameMode closes the container but leaves usingItem and gliding set. Switching while eating or charging a crossbow therefore leaves the item-use tick path active; switching while gliding leaves elytra durability ticking until those states are cleared. Vanilla cancels item use, clears the gliding flag and resets elytra flight time when entering spectator. The spectator transition should perform that cleanup too.

  2. Spectators can still trample farmland through landing callbacks. The new exclusions cover EntityInsider and EntityStepper, but Move still calls updateFallState, and fall dispatches EntityLand without a spectator check. Descending more than three blocks onto farmland can therefore reach Farmland.EntityLand and turn it into dirt. Vanilla's farmland fall-transform routine requires the player's effective Mine ability, which is false in the spectator layer. The landing interaction path needs a spectator exclusion as well.

Vanilla evidence: source-backed Bedrock client 1.26.50.26, spectator transition RVA 0x1f0ab0 (item-use cleanup 0x1fc050), farmland fall-transform RVA 0x8717560, and spectator abilities RVA 0x21b1d0. The ability override was also cross-checked against BDS 1.26.50.25, RVA 0x2bc1c0. These findings come from binary/source comparison; I have not reproduced the two cases in a live client.

THEBOSS9345 added a commit to helix-bedrock/helix that referenced this pull request Oct 12, 2026
Port of Dragonfly PR #1471 by MEMOxiiii (df-mc/dragonfly#1471, open when ported, MIT), with the fall and game data hunks merged by hand.

Signed-off-by: THEBOSS9345 <125090249+THEBOSS9345@users.noreply.github.com>
@TwistedAsylumMC
TwistedAsylumMC merged commit a3d76f1 into df-mc:master Oct 28, 2026
1 check passed
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.

5 participants