#๐ Mineflayer issues
14 messages ยท Page 1 of 1 (latest)
@untold pike
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
error:
[JSE] throw error;
[JSE] ^
[JSE]
[JSE] TypeError [ERR_INVALID_ARG_TYPE]: The "list" argument must be an instance of Array. Received an instance of Buffer
[JSE] at Function.concat (node:buffer:578:3)
[JSE] at updateAndValidateSession (C:\Users\yanya\PycharmProjects\mftest.venv\Lib\site-packages\javascript\js\node_modules\minecraft-protocol\src\client\chat.js:61:114)
[JSE] at Client.<anonymous> (C:\Users\yanya\PycharmProjects\mftest.venv\Lib\site-packages\javascript\js\node_modules\minecraft-protocol\src\client\chat.js:192:55)
[JSE] at Client.emit (node:events:524:28)
[JSE] at emitPacket (C:\Users\yanya\PycharmProjects\mftest.venv\Lib\site-packages\javascript\js\node_modules\minecraft-protocol\src\client.js:84:12)
[JSE] at FullPacketParser.<anonymous> (C:\Users\yanya\PycharmProjects\mftest.venv\Lib\site-packages\javascript\js\node_modules\minecraft-protocol\src\client.js:113:9)
[JSE] at FullPacketParser.emit (node:events:524:28)
[JSE] at addChunk (C:\Users\yanya\PycharmProjects\mftest.venv\Lib\site-packages\javascript\js\node_modules\readable-stream\lib\internal\streams\readable.js:323:12)
[JSE] at readableAddChunk (C:\Users\yanya\PycharmProjects\mftest.venv\Lib\site-packages\javascript\js\node_modules\readable-stream\lib\internal\streams\readable.js:300:9)
[JSE] at Readable.push (C:\Users\yanya\PycharmProjects\mftest.venv\Lib\site-packages\javascript\js\node_modules\readable-stream\lib\internal\streams\readable.js:246:10) {
[JSE] code: 'ERR_INVALID_ARG_TYPE'
[JSE] }
[JSE]
[JSE] Node.js v20.19.3
Hello,what's your issue exactly?
when I send a message in chat, I get that error, and the bot leaves the game
i get that type error of list arg instead of buffer
The message you get is a Buffer, not a string.
Just decode it before using:
msg = message.decode('utf-8')
bot.chat('Hi, you said ' + msg)
This should fix it for you hopefully
tried that already, still had the same issue
Ohh,wait let me try it on my pc and try debugging it
Okay try this
make sure the bot version matches the server. Add 'version': '1.20.1' (or whatever your MC server is) when creating the bot:
bot = mineflayer.createBot({
'host': '192.168.50.250',
'port': 10000,
'username': BOT_USERNAME,
'version': '1.20.1'
})
If versions mismatch, chat packets can break like that.
!close
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.