Closed nisutec closed 4 years ago
you can get the chat packet event directly and access the position property : https://github.com/PrismarineJS/mineflayer/blob/master/lib/plugins/chat.js#L42
https://minecraft-data.prismarine.js.org/?d=protocol#toClient_chat that's the chat packet can you add the position (and maybe sender) field to the mineflayer event so other people will be able to use that too?
This works thanks for the help @Karang
Versions
Detailed description of a problem
The default “Minecraft ChatMessagePacket“ has three position values.
At the moment the “message” event will trigger on all three positions. And the “jsonMsg” Object has no type or position identifier to identify a specific message type.
What did you try yet?
I have tried to find an identifier in the “jsonMsg” Object to identify the massage position
Your current code
Expected behavior
A possibility to identify the position of a message to exclude “GAME_INFO” messages from this event.
Additional context
All “jsonMsg” Objects have the same format it is not possible to show differences only with the row json body.