PrismarineJS / mineflayer

Create Minecraft bots with a powerful, stable, and high level JavaScript API.
https://prismarinejs.github.io/mineflayer/
MIT License
4.95k stars 904 forks source link

Error causing bot to crash upon moving servers #757

Closed 1by closed 5 years ago

1by commented 5 years ago

Alright so, this is sorta related to #677 Tried this on versions: 1.8, 1.8.8, 1.8.9, 1.12.1,1.12.2, Server has their own custom spigot, Worked perfectly in the hub server, about 5 seconds after it moved to /server factions, it crashed with that error, Latest mineflayer version. All i expected it to do was stay on /server factions.

C:\Users\Seppe\node_modules\mineflayer\lib\plugins\inventory.js:390 assert.ok(click.id <= actionId) ^

TypeError: Cannot read property 'id' of undefined at confirmTransaction (C:\Users\Seppe\node_modules\mineflayer\lib\plugins\inventory.js:390:21) at Client.bot._client.on (C:\Users\Seppe\node_modules\mineflayer\lib\plugins\inventory.js:502:5) at Client.emit (events.js:182:13) at FullPacketParser.deserializer.on (C:\Users\Seppe\node_modules\minecraft-protocol\src\client.js:82:12) at FullPacketParser.emit (events.js:182:13) at addChunk (C:\Users\Seppe\node_modules\protodef\node_modules\readable-stream\lib_stream_readable.js:301:12) at readableAddChunk (C:\Users\Seppe\node_modules\protodef\node_modules\readable-stream\lib_stream_readable.js:283:11) at FullPacketParser.Readable.push (C:\Users\Seppe\node_modules\protodef\node_modules\readable-stream\lib_stream_readable.js:247:10) at FullPacketParser.Transform.push (C:\Users\Seppe\node_modules\protodef\node_modules\readable-stream\lib_stream_transform.js:149:32) at FullPacketParser._transform (C:\Users\Seppe\node_modules\protodef\src\serializer.js:85:10)

rom1504 commented 5 years ago

Can you turn on debug mode (see readme as to how) and report the packets ?

On Sun, Dec 23, 2018, 00:54 1by notifications@github.com wrote:

Alright so, this is sorta related to #677 https://github.com/PrismarineJS/mineflayer/issues/677 Tried this on versions: 1.8, 1.8.8, 1.8.9, 1.12.1,1.12.2, Server has their own custom spigot, Worked perfectly in the hub server, about 5 seconds after it moved to /server factions, it crashed with that error, Latest mineflayer version. All i expected it to do was stay on /server factions.

C:\Users\Seppe\node_modules\mineflayer\lib\plugins\inventory.js:390 assert.ok(click.id <= actionId) ^

TypeError: Cannot read property 'id' of undefined at confirmTransaction (C:\Users\Seppe\node_modules\mineflayer\lib\plugins\inventory.js:390:21) at Client.bot._client.on (C:\Users\Seppe\node_modules\mineflayer\lib\plugins\inventory.js:502:5) at Client.emit (events.js:182:13) at FullPacketParser.deserializer.on (C:\Users\Seppe\node_modules\minecraft-protocol\src\client.js:82:12) at FullPacketParser.emit (events.js:182:13) at addChunk (C:\Users\Seppe\node_modules\protodef\node_modules\readable-stream\lib_stream_readable.js:301:12) at readableAddChunk (C:\Users\Seppe\node_modules\protodef\node_modules\readable-stream\lib_stream_readable.js:283:11) at FullPacketParser.Readable.push (C:\Users\Seppe\node_modules\protodef\node_modules\readable-stream\lib_stream_readable.js:247:10) at FullPacketParser.Transform.push (C:\Users\Seppe\node_modules\protodef\node_modules\readable-stream\lib_stream_transform.js:149:32) at FullPacketParser._transform (C:\Users\Seppe\node_modules\protodef\src\serializer.js:85:10)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/PrismarineJS/mineflayer/issues/757, or mute the thread https://github.com/notifications/unsubscribe-auth/ACPN_pRYUqj5MTMxQ18UHljhxwOi4CPoks5u7sYtgaJpZM4Zfpx0 .

1by commented 5 years ago

d packet play.entity_teleport +3ms minecraft-protocol { minecraft-protocol "entityId": 3555035, minecraft-protocol "x": -1088, minecraft-protocol "y": 2752, minecraft-protocol "z": -736, minecraft-protocol "yaw": -128, minecraft-protocol "pitch": 0, minecraft-protocol "onGround": false minecraft-protocol } +0ms minecraft-protocol read packet play.keep_alive +1ms minecraft-protocol { minecraft-protocol "keepAliveId": 976 minecraft-protocol } +0ms minecraft-protocol writing packet play.keep_alive +0ms minecraft-protocol { keepAliveId: 976 } +1ms minecraft-protocol read packet play.transaction +0ms minecraft-protocol { minecraft-protocol "windowId": 0, minecraft-protocol "action": 976, minecraft-protocol "accepted": false minecraft-protocol } +1ms C:\Users\Seppe\node_modules\mineflayer\lib\plugins\inventory.js:390 assert.ok(click.id <= actionId) ^

TypeError: Cannot read property 'id' of undefined

This is what happened when i debugged it

1by commented 5 years ago

https://gyazo.com/657bddc90de42766235b6b62fd12d738 this is exactly what happens when the bot goes from hub to factions.

rom1504 commented 5 years ago

Can you report the full debug log (put it on gist for example), there's probably information about why that happens.

On Sun, Dec 23, 2018, 17:08 1by notifications@github.com wrote:

https://gyazo.com/657bddc90de42766235b6b62fd12d738 this is exactly what happens when the bot goes from hub to factions.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/PrismarineJS/mineflayer/issues/757#issuecomment-449646151, or mute the thread https://github.com/notifications/unsubscribe-auth/ACPN_gRDCxPTXgbGXdR0fOweVsKTywQQks5u76pmgaJpZM4Zfpx0 .

1by commented 5 years ago

https://gist.github.com/1by/1dc36b26b9ac4d4ec19a7cbcca61ff33 This is all it would let me copy, hope it helps!

1by commented 5 years ago

Any idea? I tried it on a fresh setup of mineflayer and it did the same thing, so it's definately not my code thats causing it.

rom1504 commented 5 years ago

Yes most likely this is caused by something different your server is doing with inventory and mineflayer is not handling it. Try changing inventory.js

On Mon, Dec 24, 2018, 17:21 1by notifications@github.com wrote:

Any idea? I tried it on a fresh setup of mineflayer and it did the same thing, so it's definately not my code thats causing it.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/PrismarineJS/mineflayer/issues/757#issuecomment-449751687, or mute the thread https://github.com/notifications/unsubscribe-auth/ACPN_vhwWBoI5gG76ZZ9J9EzeMiguwB7ks5u8P8ZgaJpZM4Zfpx0 .

rom1504 commented 5 years ago

now fixed