You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm pretty new to JavaScript, so I have barely any knowledge about it, I'm way more confident in Java.
I tried to create a bot for Minecraft running on 1.19.2 which is possible since the last build, but unfortunately it seems like sending messages doesn't work in this version yet.
What did you try yet?
I really don't have an idea how to address the issue, that's why I create this issue.
I get this error:
TypeError: Serialization error for play.toServer : SizeOf error for undefined : Cannot read property 'length' of undefined
at Object.previousMessages (eval at compile (D:\JavaScript\node_modules\protodef\src\compiler.js:258:12), <anonymous>:175:37)
at Object.packet_chat_command (eval at compile (D:\JavaScript\node_modules\protodef\src\compiler.js:258:12), <anonymous>:559:37)
at eval (eval at compile (D:\JavaScript\node_modules\protodef\src\compiler.js:258:12), <anonymous>:1186:64)
at packet (eval at compile (D:\JavaScript\node_modules\protodef\src\compiler.js:258:12), <anonymous>:1235:9)
at CompiledProtodef.sizeOf (D:\JavaScript\node_modules\protodef\src\compiler.js:89:14)
at e.message (D:\JavaScript\node_modules\protodef\src\compiler.js:96:40)
at tryCatch (D:\JavaScript\node_modules\protodef\src\utils.js:50:16)
at CompiledProtodef.createPacketBuffer (D:\JavaScript\node_modules\protodef\src\compiler.js:96:20)
at Serializer.createPacketBuffer (D:\JavaScript\node_modules\protodef\src\serializer.js:12:23)
at Serializer._transform (D:\JavaScript\node_modules\protodef\src\serializer.js:18:18) {
field: 'play.toServer'
}
Your current code
constmineflayer=require('mineflayer')constoptions={host: 'server.address',// Change this to the ip you want.port: 25565,// Change this to the port you want.username: 'nope',password: 'notThisTime',auth: 'microsoft',version: '1.19.2'}lettimeToStart=Date.now();constbot=mineflayer.createBot(options)bot.once('spawn',()=>{timeToStart=Date.now()-timeToStartconsole.log('Hello, I\'m '+bot.username+". I have successfully connected to "+options.host+" with version "+options.version+" in "+timeToStart+"ms")bot.acceptResourcePack();setTimeout(()=>{bot.chat('Hello')},15000);})bot.on('chat',(username,message)=>{if(username===bot.username)returnconsole.log(`${username} > ${message}`)})
Expected behavior
Joining on the server is working flawless, but it won't send the message "Hello" in the chat.
I only get an error telling me that the serialization went wrong.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Oh, I thought they added finally the support for 1.19.2 with the most recent update. Before it wasn't even possible to join on servers with 1.19.2, now you can.
Versions
Detailed description of a problem
I'm pretty new to JavaScript, so I have barely any knowledge about it, I'm way more confident in Java.
I tried to create a bot for Minecraft running on 1.19.2 which is possible since the last build, but unfortunately it seems like sending messages doesn't work in this version yet.
What did you try yet?
I really don't have an idea how to address the issue, that's why I create this issue.
I get this error:
Your current code
Expected behavior
Joining on the server is working flawless, but it won't send the message "Hello" in the chat.
I only get an error telling me that the serialization went wrong.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: