Skip to content

fix: patch mineflayer dimension type lookup for proxy/modded servers#535

Open
arraytad wants to merge 1 commit intozardoy:nextfrom
Arrayscape:bugfix-mineflayer-dimension
Open

fix: patch mineflayer dimension type lookup for proxy/modded servers#535
arraytad wants to merge 1 commit intozardoy:nextfrom
Arrayscape:bugfix-mineflayer-dimension

Conversation

@arraytad
Copy link
Copy Markdown

@arraytad arraytad commented Apr 8, 2026

Summary

  • Backport upstream PrismarineJS/mineflayer fix for dimension type vs world name confusion in the game plugin
  • On proxy/modded servers (e.g. BungeeCord/Velocity with Skyblock), bot.game.dimension was set from packet.worldName (e.g. bskyblock_world) but the dimension registry uses dimension type names (e.g. overworld). The registry lookup failed, causing minY/height to default to 0/256 instead of -64/384, which shifted all chunk geometry up by 64 blocks — making terrain invisible.

Root cause

In Minecraft 1.19+, login/respawn packets have two separate fields:

  • Dimension type (worldType in login, dimension in respawn) — e.g. overworld
  • World name (worldName) — e.g. bskyblock_world

On vanilla servers these are the same value, but on proxy/modded servers they differ. The fork's mineflayer used the world name for the registry lookup, which failed for custom world names, causing chunk data to be parsed with wrong world height parameters.

Summary by CodeRabbit

Release Notes

  • Chores

    • Updated dependency patch management configuration.
  • Bug Fixes

    • Improved dimension handling for Minecraft 1.19+ versions with enhanced world type identification and fallback logic.

Backport upstream PrismarineJS/mineflayer fix. The game plugin used
packet.worldName (world name) for the dimension registry lookup, but the
registry stores dimension types (overworld, the_nether, the_end). On
vanilla servers these are the same, but on proxy/modded servers the world
name can differ (e.g. "bskyblock_world"), causing the lookup to fail and
minY/height to default to 0/256 instead of -64/384. This shifted all
chunk geometry up by 64 blocks, making terrain invisible.

Fix uses packet.worldType (login) or packet.dimension (respawn) — the
actual dimension type — for the lookup instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 8, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9ac04867-606d-4cb9-81b4-5011062a6ec8

📥 Commits

Reviewing files that changed from the base of the PR and between bec1013 and 4c467d6.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • package.json
  • patches/mineflayer.patch

📝 Walkthrough

Walkthrough

The changes introduce a new pnpm patch for mineflayer that modifies dimension assignment logic in the game plugin, updating it to prefer packet.worldType over packet.worldName for Minecraft 1.19+ with fallback handling and prefix stripping.

Changes

Cohort / File(s) Summary
Configuration
package.json
Added mineflayer to pnpm.patchedDependencies, mapping to patches/mineflayer.patch.
Mineflayer Patch
patches/mineflayer.patch
Updated lib/plugins/game.js dimension assignment logic to prefer packet.worldType over packet.worldName when dimensionDataInCodec is enabled, with fallback handling and minecraft: prefix stripping.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

Review effort 3/5

Poem

🐰 Through dimensions vast, a patch takes flight,
WorldType now leads, a switch quite right!
Prefixes stripped with careful care,
Fallbacks ready, always there,
Mineflayer's world logic shines bright! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically identifies the main fix: updating mineflayer's dimension type lookup logic for proxy/modded servers, which aligns directly with the core change of patching dimension assignment in game.js.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zardoy
Copy link
Copy Markdown
Owner

zardoy commented Apr 8, 2026

Thanks! Forgot to take care of it yesterday, will resolve it within a few hours

@arraytad
Copy link
Copy Markdown
Author

arraytad commented Apr 8, 2026

Thanks! Forgot to take care of it yesterday, will resolve it within a few hours

no rush! I'm also not confident this is really the best solution, since it turns out it was fixed in upstream mineflayer, maybe the better solution is to update, but that's a big undertaking, and you might have forked it due to other issues...

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