feat(minecraft): add automatic reconnection with configurable retry limit

Add reconnect option to MineflayerOptions with enabled flag and maxRetries (default: 5), implement tryReconnect method to handle kicked/end events, extract setupBotEventHandlers to reuse on reconnect, track reconnect state with reconnectAttempts/isReconnecting/isStopping flags, add @types/node dependency for setTimeout typing
This commit is contained in:
Rin
2026-02-18 11:14:37 +08:00
committed by Neko Ayaka
parent b20d55508e
commit c250ecfeec
4 changed files with 169 additions and 1 deletions
+1
View File
@@ -44,6 +44,7 @@
"zod-to-json-schema": "^3.25.1"
},
"devDependencies": {
"@types/node": "^22.15.0",
"@types/ws": "catalog:"
}
}