Closed Redbandithero closed 1 year ago
Just tested putting in a predetermined input for the problem and it made it work slightly, enough to atleast get to the other problem which is the very next line of chat.js.
The first problem can be fixed (to my knowledge) by just using that new variable and removing the JSON.parse. The second instance of the problem doesn't appear to have any alternative variables.
... doesn't appear to have any alternative variables.
Current solution is to just replace it with a empty string, solves the crash but means the bot cannot read chat at all. If anyone has a better solution (which is very likely), then please tell me as I would like the bot to have access to chat.
1.19.2 isn't supported yet
Versions
Detailed description of a problem
SyntaxError: Unexpected token u in JSON at position 0 On line 135 of chat.js in \node_modules\mineflayer\lib\plugins\chat.js packet.senderName is parsed into JSON unsuccessfully, this is due to packet.senderName being "undefined".
I am not currently using any chat methods in my index.js but the bot crashes immediately after anyone chats on the server.
What did you try yet?
I have tried modifying the packet.senderName to contain curly brackets at the beginning and end while also using the real sender's username provided by "const sender = bot.uuidToUsername[packet.senderUuid]" on line 129 of chat.js.
Your current code
Expected behavior
The bot is expected to have no response to chat messages.
Additional context
I have tried running the bot on multiple different versions of node and different machines with no success.
Ingame Example: https://streamable.com/og9byr