PondWader / Mineflayer-Spectator

Spectate your Mineflayer bot in-game.
MIT License
10 stars 1 forks source link

Error from example #3

Closed ItzAaronUwU closed 2 weeks ago

ItzAaronUwU commented 2 weeks ago

Disconnecting client because error TypeError: Serialization error for play.toClient : Write error for undefined : Cannot read properties of undefined (reading 'length') at module.exports.Write.UUID (C:\Users\ItzAaron\Stuff\node_modules\minecraft-protocol\src\datatypes\compiler-minecraft.js:48:25) at Object.packet_spawn_entity (eval at compile (C:\Users\ItzAaron\Stuff\node_modules\protodef\src\compiler.js:258:12), <anonymous>:748:26) at eval (eval at compile (C:\Users\ItzAaron\Stuff\node_modules\protodef\src\compiler.js:258:12), <anonymous>:3318:64) at packet (eval at compile (C:\Users\ItzAaron\Stuff\node_modules\protodef\src\compiler.js:258:12), <anonymous>:3430:9) at CompiledProtodef.write (C:\Users\ItzAaron\Stuff\node_modules\protodef\src\compiler.js:76:12) at e.message (C:\Users\ItzAaron\Stuff\node_modules\protodef\src\compiler.js:102:25) at tryCatch (C:\Users\ItzAaron\Stuff\node_modules\protodef\src\utils.js:50:16) at CompiledProtodef.createPacketBuffer (C:\Users\ItzAaron\Stuff\node_modules\protodef\src\compiler.js:102:5) at Serializer.createPacketBuffer (C:\Users\ItzAaron\Stuff\node_modules\protodef\src\serializer.js:12:23) at Serializer._transform (C:\Users\ItzAaron\Stuff\node_modules\protodef\src\serializer.js:18:18) { field: 'play.toClient' }

The server shows perfectly fine inside the server list. However, trying to join spams my console with this error. Followed the example down to the letter and it just throws this over and over

ItzAaronUwU commented 2 weeks ago

image_2024-09-01_230109236 Also getting this show up in the minecraft client I'm trying to join on

PondWader commented 2 weeks ago

Hi, what version are you using for your mineflayer bot and Minecraft client?

ItzAaronUwU commented 2 weeks ago

I'm using 1.20.1 for both, following what your README says

EDIT: I would like to point out also that I tried on a fresh vanilla server just to make sure, throws the same error

PondWader commented 2 weeks ago

If the server that your bot is connected to is public, would you mind sharing the address so that I can test tomorrow.

I'm not quite sure how something could break since this was developed and tested on 1.20.1 but I'll take a look and try to recreate tmr.

ItzAaronUwU commented 2 weeks ago

If the server that your bot is connected to is public, would you mind sharing the address so that I can test tomorrow.

I can do that sure, the server I want it to work on I'll send here theuniverse.network

I appreciate you helping too, thank you

PondWader commented 2 weeks ago

Fixed in https://github.com/PondWader/Mineflayer-Spectator/commit/ab5a424516b24b75f0fa85f32f81ac8462504386. Install with npm i mineflayer-spectator@latest.

I'm not sure how this started to occur to be honest since as far as I can tell there were no changes to any PrismarineJS projects that would affect this and it definitely worked before.