urFate / Afk-Bot

Funcional minecraft AFK bot for servers. Anti-AFK, Auto-Auth, Microsoft/Offline accounts support.
MIT License
113 stars 460 forks source link

Crash when died and reconnecting #64

Open khalimwu opened 1 year ago

khalimwu commented 1 year ago

Logged, had a zombie nearby, died, used console to teleport the bot, died again, did this 2 more times. then it started to crash

Adding the log:

C:\MyGame\Afk-Bot-1.3.3>node . [2023-02-17T14:19:50.931] [INFO] default - Bot joined to the server [2023-02-17T14:19:50.934] [INFO] default - Starting moving to target location (-260, 46, -57) Error: read ECONNRESET at TCP.onStreamRead (node:internal/stream_base_commons:217:20) { errno: -4077, code: 'ECONNRESET', syscall: 'read' } [2023-02-17T14:19:51.436] [ERROR] default - read ECONNRESET [2023-02-17T14:19:57.731] [INFO] default - Bot joined to the server [2023-02-17T14:19:57.732] [INFO] default - Starting moving to target location (-260, 46, -57) Error: read ECONNRESET at TCP.onStreamRead (node:internal/stream_base_commons:217:20) { errno: -4077, code: 'ECONNRESET', syscall: 'read' } [2023-02-17T14:19:58.540] [ERROR] default - read ECONNRESET [2023-02-17T14:20:05.043] [INFO] default - Bot joined to the server [2023-02-17T14:20:05.044] [INFO] default - Starting moving to target location (-260, 46, -57) Error: write ECONNABORTED at afterWriteDispatched (node:internal/stream_base_commons:160:15) at writeGeneric (node:internal/stream_base_commons:151:3) at Socket._writeGeneric (node:net:930:11) at Socket._write (node:net:942:8) at writeOrBuffer (node:internal/streams/writable:392:12) at _write (node:internal/streams/writable:333:10) at Writable.write (node:internal/streams/writable:337:10) at Framer.ondata (C:\MyGame\Afk-Bot-1.3.3\node_modules\minecraft-protocol\node_modules\readable-stream\lib\internal\streams\readable.js:662:22) at Framer.emit (node:events:513:28) at addChunk (C:\MyGame\Afk-Bot-1.3.3\node_modules\minecraft-protocol\node_modules\readable-stream\lib\internal\streams\readable.js:278:12) { errno: -4079, code: 'ECONNABORTED', syscall: 'write' } [2023-02-17T14:20:05.683] [ERROR] default - write ECONNABORTED [2023-02-17T14:20:11.862] [INFO] default - Bot joined to the server [2023-02-17T14:20:11.863] [INFO] default - Starting moving to target location (-260, 46, -57) C:\MyGame\Afk-Bot-1.3.3\bot.js:148 reasonText = reasonText.replace(/§./g, ''); ^

TypeError: Cannot read properties of undefined (reading 'replace') at EventEmitter. (C:\MyGame\Afk-Bot-1.3.3\bot.js:148:31) at EventEmitter.emit (node:events:513:28) at Client. (C:\MyGame\Afk-Bot-1.3.3\node_modules\mineflayer\lib\plugins\kick.js:5:9) at Client.emit (node:events:513:28) at FullPacketParser. (C:\MyGame\Afk-Bot-1.3.3\node_modules\minecraft-protocol\src\client.js:91:12) at FullPacketParser.emit (node:events:513:28) at addChunk (C:\MyGame\Afk-Bot-1.3.3\node_modules\readable-stream\lib_stream_readable.js:298:12) at readableAddChunk (C:\MyGame\Afk-Bot-1.3.3\node_modules\readable-stream\lib_stream_readable.js:280:11) at Readable.push (C:\MyGame\Afk-Bot-1.3.3\node_modules\readable-stream\lib_stream_readable.js:241:10) at Transform.push (C:\MyGame\Afk-Bot-1.3.3\node_modules\readable-stream\lib_stream_transform.js:139:32)

Node.js v18.14.1