PrismarineJS / mineflayer

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

Some servers are not working #624

Closed Wqrld closed 5 years ago

Wqrld commented 6 years ago
var bot = mineflayer.createBot({
  host: "ip", // optional
  port: 25565,       // optional
  username: "right", // email and password are required only for
  password: "right",          // online-mode=true servers
});
bot.on('chat', function(username, message) {
});

gives:

pi@raspberry:~/factions $ node index.js
/home/pi/node_modules/minecraft-protocol/src/transforms/framing.js:76
          throw e;
          ^

Error: Deserialization error for play.toClient : write callback called multiple times
    at afterTransform (/home/pi/node_modules/protodef/node_modules/readable-stream/lib/_stream_transform.js:96:33)
    at TransformState.afterTransform (/home/pi/node_modules/protodef/node_modules/readable-stream/lib/_stream_transform.js:79:12)
    at FullPacketParser._transform (/home/pi/node_modules/protodef/src/serializer.js:85:7)
    at FullPacketParser.Transform._read (/home/pi/node_modules/protodef/node_modules/readable-stream/lib/_stream_transform.js:182:10)
    at FullPacketParser.Transform._write (/home/pi/node_modules/protodef/node_modules/readable-stream/lib/_stream_transform.js:170:83)
    at doWrite (/home/pi/node_modules/protodef/node_modules/readable-stream/lib/_stream_writable.js:406:64)
    at writeOrBuffer (/home/pi/node_modules/protodef/node_modules/readable-stream/lib/_stream_writable.js:395:5)
    at FullPacketParser.Writable.write (/home/pi/node_modules/protodef/node_modules/readable-stream/lib/_stream_writable.js:322:11)
    at Decompressor.ondata (/home/pi/node_modules/minecraft-protocol/node_modules/readable-stream/lib/_stream_readable.js:612:20)
    at Decompressor.emit (events.js:159:13)

when starting

edit: latest version of mineflayer

Wqrld commented 6 years ago

works on my pc with node v8.9.1 but not on my rpi with node v9.2.1

Wqrld commented 6 years ago

wuut it works now weird

rom1504 commented 6 years ago

weird error. Apparently it's related to FullPacketParser which I added recently.

I don't really understand what it means, but if you can reproduce it, please keep this updated.

Wqrld commented 6 years ago

dont know if it is related but this happened randomly while the bot was running

events.js:136
      throw er; // Unhandled 'error' event
      ^

Error: Deserialization error for play.toClient : Data buffer not correct size (was 196608, expected 196864)
    at Chunk.load (/home/pi/node_modules/prismarine-chunk/src/pc/1.8/chunk.js:192:13)
    at addColumn (/home/pi/node_modules/mineflayer/lib/plugins/blocks.js:46:12)
    at Client.bot._client.on (/home/pi/node_modules/mineflayer/lib/plugins/blocks.js:166:5)
    at Client.emit (events.js:159:13)
    at FullPacketParser.deserializer.on (/home/pi/node_modules/minecraft-protocol/src/client.js:103:12)
    at FullPacketParser.emit (events.js:159:13)
    at addChunk (/home/pi/node_modules/protodef/node_modules/readable-stream/lib/_stream_readable.js:284:12)
    at readableAddChunk (/home/pi/node_modules/protodef/node_modules/readable-stream/lib/_stream_readable.js:271:11)
    at FullPacketParser.Readable.push (/home/pi/node_modules/protodef/node_modules/readable-stream/lib/_stream_readable.js:238:10)
    at FullPacketParser.Transform.push (/home/pi/node_modules/protodef/node_modules/readable-stream/lib/_stream_transform.js:146:32)
DesWurstes commented 6 years ago

I have a very similar issue. I type my email instead of my username, could this be the cause?

/Users/nj/Downloads/mineflayer-master/node_modules/minecraft-protocol/src/transforms/framing.js:76
          throw e;
          ^

Error: Deserialization error for play.toClient : write callback called multiple times
    at afterTransform (/Users/nj/Downloads/mineflayer-master/node_modules/readable-stream/lib/_stream_transform.js:96:33)
    at TransformState.afterTransform (/Users/nj/Downloads/mineflayer-master/node_modules/readable-stream/lib/_stream_transform.js:79:12)
    at FullPacketParser._transform (/Users/nj/Downloads/mineflayer-master/node_modules/protodef/src/serializer.js:85:7)
    at FullPacketParser.Transform._read (/Users/nj/Downloads/mineflayer-master/node_modules/readable-stream/lib/_stream_transform.js:182:10)
    at FullPacketParser.Transform._write (/Users/nj/Downloads/mineflayer-master/node_modules/readable-stream/lib/_stream_transform.js:170:83)
    at doWrite (/Users/nj/Downloads/mineflayer-master/node_modules/readable-stream/lib/_stream_writable.js:406:64)
    at writeOrBuffer (/Users/nj/Downloads/mineflayer-master/node_modules/readable-stream/lib/_stream_writable.js:395:5)
    at FullPacketParser.Writable.write (/Users/nj/Downloads/mineflayer-master/node_modules/readable-stream/lib/_stream_writable.js:322:11)
    at Decompressor.ondata (/Users/nj/Downloads/mineflayer-master/node_modules/readable-stream/lib/_stream_readable.js:612:20)
    at Decompressor.emit (events.js:159:13)
Wqrld commented 6 years ago

dont think so, im fairly sure that i had used my email but ill try again

edit: weird dont think using username even works for me can you try again using mail?

DesWurstes commented 6 years ago

OK, now I see that it works on other servers, however it has problems with 2b2t's weird void waiting queue. (It seems this issue is not related to it.)

No problems other than this. Thanks.

rom1504 commented 6 years ago

It would be very useful to make a list of servers with issues so someone (me or other contributors) can easily go through the list and solve the issues. If one of you want to create that list (in a new issue) it would be appreciated.

On Sat, Jan 13, 2018, 19:08 DesWurstes notifications@github.com wrote:

OK, now I see that it works on other servers, however it has problems with 2b2t's weird void waiting queue.

No problems mostly. Thanks.

— You are receiving this because you commented.

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

rom1504 commented 5 years ago

This is fixed