
A small client-side Fabric mod for people who restart their dev server twenty times an hour.
It adds two buttons to the vanilla **disconnected** screen:
| Button | What it does |
|---|---|
| `Reconnect` | Rejoins the last server immediately. |
| `Auto-Reconnect: ON / OFF` | Persistent toggle. While it is on **and the disconnected screen is open**, the mod checks every few seconds whether the server is back up, and starts the normal join cycle the moment it is. |
A status line under the buttons shows what it is doing (`Checking again in 3s (attempt 4)`, `Server is up - joining!`, …).
So the plugin workflow becomes: `/stop` → rebuild → start server → you are already back in the world.
## Behaviour
- **Only runs on the disconnected screen.** Pressing the vanilla button, hitting Escape or going anywhere else cancels the retry loop instantly. Nothing runs in the background while you are in a menu or in another world.
- **The check is a real Server List Ping**, the same handshake the multiplayer server list uses, so a server whose port is open but which is still starting up is not counted as ready. DNS `SRV` records and the client's blocked-server list are resolved exactly like a normal join.
- **The server it retries is captured while you are still connected**, because Minecraft clears the current server entry during disconnect. Direct Connect and LAN servers work; Realms is skipped, since Realms addresses are temporary.
- Checks run on their own daemon thread, so a hanging DNS lookup or a firewalled host never freezes the game.
- Being kicked is not treated differently from a crash: if you were kicked, the server is up, so it will rejoin. Turn the toggle off, or set `maxAttempts`, if that is not what you want.
## Settings
`config/autojoin.json`, written on first launch:
```json
{
"autoReconnect": false,
"pingIntervalSeconds": 3,
"maxAttempts": 0,
"pingTimeoutMillis": 3000,
"requireStatusResponse": true,
"playSoundOnReconnect": true
}
```
- `autoReconnect` — same value the in-game button toggles.
- `pingIntervalSeconds` — delay between checks, minimum 1.
- `maxAttempts` — `0` keeps retrying forever.
- `pingTimeoutMillis` — connect/read timeout for a single check.
- `requireStatusResponse` — when `false`, an open TCP port is enough. Only useful behind a proxy that accepts connections before it can answer a status request; it can make the client rejoin too early.
- `playSoundOnReconnect` — small ping sound when the rejoin fires, so you notice while alt-tabbed.

