Skip to content

Add Velocity proxy support for 1.20.2+ configuration phase#3834

Open
plainprince wants to merge 4 commits into
PrismarineJS:masterfrom
plainprince:fix-velocity-configuration-phase
Open

Add Velocity proxy support for 1.20.2+ configuration phase#3834
plainprince wants to merge 4 commits into
PrismarineJS:masterfrom
plainprince:fix-velocity-configuration-phase

Conversation

@plainprince
Copy link
Copy Markdown
Contributor

Summary

Picks up #3786 by @StarWeizz and fixes the CI failures.

Adds a velocity plugin that handles the re-configuration phase during Velocity proxy server transfers (1.20.2+). Without this, the bot sends gameplay packets (movement, physics) during configuration, causing disconnections.

What the plugin does

  • Tracks when the bot re-enters configuration phase (server transfers)
  • Disables physics during configuration to prevent movement packets
  • Auto-accepts resource packs during configuration (required for transfer to complete)
  • Re-enables physics after configuration finishes

CI fix

The original PR's velocity plugin was activating during the initial login configuration phase (which node-minecraft-protocol already handles), causing:

  • Duplicate finish_configuration acknowledgement packets
  • Physics disabled during login, preventing spawn
  • Timeouts on all 1.20.2+ test versions

Fixed by only activating after the bot's first spawn -- the initial login configuration is left entirely to node-minecraft-protocol.

Other fixes

  • Lint errors (missing newlines at EOF, object-shorthand)
  • Removed redundant registry_data/select_known_packs listeners (minecraft-protocol handles these)

Fixes #3764
Supersedes #3786

Test plan

  • CI passes for all versions (1.8.8 through 1.21.8)
  • Lint passes
  • No regressions on existing tests
  • Velocity proxy transfers work on 1.20.2+ (manual test)

Made with Cursor

StarWeizz and others added 2 commits February 14, 2026 15:12
Fixes PrismarineJS#3764

This commit adds proper handling of the configuration phase introduced
in Minecraft 1.20.2 and extended in 1.21+, which is required for server
transfers via Velocity proxy.

Changes:
- New velocity plugin to manage configuration phase state
- Modified physics plugin to block movement packets during configuration
- Automatic resource pack acceptance during configuration phase
- New examples demonstrating Velocity proxy connection and transfers

The bot will no longer be kicked with 'Disconnected, while in
configuration phase' errors during Velocity server transfers.
The velocity plugin was activating during the initial 1.20.2+ login
configuration phase, which is already handled by node-minecraft-protocol.
This caused duplicate finish_configuration packets and disabled physics
during login, making the bot unable to spawn on 1.20.2+ servers.

Changes:
- Only activate configuration phase handling after first spawn
- Remove duplicate finish_configuration write (minecraft-protocol handles it)
- Remove redundant registry_data/select_known_packs listeners
- Fix missing newlines at EOF (lint errors)
- Fix object-shorthand lint warnings

Co-authored-by: Cursor <cursoragent@cursor.com>
@rom1504
Copy link
Copy Markdown
Member

rom1504 commented Mar 28, 2026

How can we add tests for this ?

@wupengabc
Copy link
Copy Markdown

How can we add tests for this ?

Consider setting up two new Paper servers and a Velocity proxy for testing. Then use /server paper2 and /server paper1 to switch between them and verify whether the bot gets kicked.

@plainprince
Copy link
Copy Markdown
Contributor Author

Automated tests for Velocity proxy server transfers aren't feasible to add to CI because they require:

  1. Two separate Paper servers running simultaneously
  2. A Velocity proxy configured to link them
  3. The bot connecting through the proxy and executing /server commands to trigger transfers

The current CI infrastructure only spins up a single vanilla Minecraft server per test run, with no proxy support. Setting up a multi-server + proxy environment would significantly increase CI complexity and runtime.

This would need to be validated through manual testing with an actual Velocity proxy setup, or by adding dedicated integration test infrastructure that can orchestrate multiple servers and a proxy.

1 similar comment
@plainprince
Copy link
Copy Markdown
Contributor Author

Automated tests for Velocity proxy server transfers aren't feasible to add to CI because they require:

  1. Two separate Paper servers running simultaneously
  2. A Velocity proxy configured to link them
  3. The bot connecting through the proxy and executing /server commands to trigger transfers

The current CI infrastructure only spins up a single vanilla Minecraft server per test run, with no proxy support. Setting up a multi-server + proxy environment would significantly increase CI complexity and runtime.

This would need to be validated through manual testing with an actual Velocity proxy setup, or by adding dedicated integration test infrastructure that can orchestrate multiple servers and a proxy.

@extremeheat
Copy link
Copy Markdown
Member

We should not have to do any special logic for mods if vanilla client works as is. It seems you are describing an issue in nmp that should be fixed there, not here

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.

Server redirection error

5 participants