Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jul 16, 2025

In newer versions of Minecraft, the --server and --port launch arguments have been replaced with a single --quickPlayMultiplayer option. This PR adds support for the new option while maintaining backward compatibility.

Changes

  • Added quickPlayMultiplayer option to LaunchOption interface for direct server connection using the new format
  • Updated argument generation logic to use --quickPlayMultiplayer when provided, with precedence over legacy --server/--port options
  • Added createQuickPlayMultiplayer() helper function to easily format server IP and port into the required string format
  • Maintained full backward compatibility with existing server: { ip, port } option
  • Added comprehensive tests covering all new functionality and edge cases
  • Updated documentation with usage examples and migration guidance

Usage Examples

import { launch, createQuickPlayMultiplayer } from "@xmcl/core"

// New quickPlayMultiplayer option
await launch({
  version: '1.20.1',
  gamePath: '/path/to/.minecraft',
  javaPath: '/path/to/java',
  quickPlayMultiplayer: 'play.hypixel.net:25565'
})

// Helper function for easy formatting
await launch({
  version: '1.20.1', 
  gamePath: '/path/to/.minecraft',
  javaPath: '/path/to/java',
  quickPlayMultiplayer: createQuickPlayMultiplayer('mc.example.com', 8080)
})

// Legacy server option still works
await launch({
  version: '1.20.1',
  gamePath: '/path/to/.minecraft', 
  javaPath: '/path/to/java',
  server: { ip: 'play.hypixel.net', port: 25565 }
})

Migration

For users wanting to use the new format:

  • Replace server: { ip: 'example.com', port: 25565 } with quickPlayMultiplayer: 'example.com:25565'
  • Or use the helper: quickPlayMultiplayer: createQuickPlayMultiplayer('example.com', 25565)

Fixes #320.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 3 commits July 16, 2025 08:52
- Add quickPlayMultiplayer option to LaunchOption interface
- Update generateArguments to handle quickPlayMultiplayer over legacy server/port options
- Add createQuickPlayMultiplayer helper function for easy migration
- Add comprehensive tests for new functionality
- Maintain backward compatibility with existing server option

Co-authored-by: ci010 <[email protected]>
- Update README with usage examples for quickPlayMultiplayer option
- Include helper function documentation
- Show backward compatibility examples
- Explain precedence when both options are provided

Co-authored-by: ci010 <[email protected]>
@Copilot Copilot AI changed the title [WIP] Support --quickPlayMultiplayer options Support --quickPlayMultiplayer options for newer Minecraft versions Jul 16, 2025
@Copilot Copilot AI requested a review from ci010 July 16, 2025 08:58
Copilot finished work on behalf of ci010 July 16, 2025 08:58
@ci010 ci010 marked this pull request as ready for review July 16, 2025 12:21
@ci010 ci010 merged commit 1e533fe into master Jul 16, 2025
0 of 2 checks passed
@ci010 ci010 deleted the copilot/fix-320 branch July 16, 2025 12:28
@github-actions github-actions bot mentioned this pull request Aug 1, 2025
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.

Support --quickPlayMultiplayer options
2 participants