feat: add support for username, IP, and port configuration via launch arguments

This commit is contained in:
daoge_cmd
2026-03-04 15:33:52 +08:00
parent 575cc4ce6e
commit 8ecfc52547
2 changed files with 48 additions and 25 deletions

View File

@@ -33,10 +33,22 @@ Basic LAN multiplayer is available on the Windows build
- Other players on the same LAN can discover the session from the in-game Join Game menu
- Game connections use TCP port `25565` by default
- LAN discovery uses UDP port `25566`
- You can override your in-game username at launch with `username.txt`
This feature is based on [LCEMP](https://github.com/LCEMP/LCEMP/)
### Launch Arguments
| Argument | Description |
|--------------------|----------------------------------------------------------------------------------------------------------------|
| `-name <username>` | Sets your in-game username |
| `-ip <address>` | Manually connect to an IP if LAN advertising does not work or if the server cannot be discovered automatically |
| `-port <port>` | Override the default port if it was changed in the source |
Example:
```
Minecraft.Client.exe -name Steve -ip 192.168.0.25 -port 25565
```
## Controls (Keyboard & Mouse)
- **Movement**: `W` `A` `S` `D`