mineflayer icon indicating copy to clipboard operation
mineflayer copied to clipboard

Chat message parameter is empty in 'chat' and 'whisper' events

Open mdmanl opened this issue 1 year ago • 13 comments

Versions

  • mineflayer: 4.23.0
  • server: vanilla 1.21.1
  • node: 20.0.0

Detailed description of a problem

When using the bot.on('chat') event, the message parameter is always empty, while the username is correctly captured.

What did you try yet?

I tried logging the parameters in the chat event and sending messages in chat, but the message parameter is consistently empty.

Your current code

const mineflayer = require('mineflayer')

const bot = mineflayer.createBot({
  host: 'localhost', // minecraft server ip
  username: 'Bot', // username to join as if auth is `offline`, else a unique identifier for this account. Switch if you want to change accounts
  auth: 'microsoft' // for offline mode servers, you can set this to 'offline'
})

bot.on('chat', (username, message) => {
  if (username === bot.username) return
  bot.chat(message)
})

// Log errors and kick reasons:
bot.on('kicked', console.log)
bot.on('error', console.log)

Expected behaviour

I expected the message parameter to contain the text of the message sent by other players in the chat.

mdmanl avatar Oct 31 '24 10:10 mdmanl

i have the same problem right now

BallisticOK avatar Nov 01 '24 11:11 BallisticOK

Tests show it works with vanilla.

Please provide more information on how to reproduce

On Fri, Nov 1, 2024, 12:57 0x00sec @.***> wrote:

i have the same problem right now

— Reply to this email directly, view it on GitHub https://github.com/PrismarineJS/mineflayer/issues/3493#issuecomment-2451757257, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR437RRYEJN5H2WVLJG4BTZ6NUBXAVCNFSM6AAAAABQ57R526VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJRG42TOMRVG4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

rom1504 avatar Nov 01 '24 12:11 rom1504

Tests show it works with vanilla. Please provide more information on how to reproduce On Fri, Nov 1, 2024, 12:57 0x00sec @.> wrote: i have the same problem right now — Reply to this email directly, view it on GitHub <#3493 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR437RRYEJN5H2WVLJG4BTZ6NUBXAVCNFSM6AAAAABQ57R526VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJRG42TOMRVG4 . You are receiving this because you are subscribed to this thread.Message ID: @.>

I tested it on multiple Vanilla servers, just to find out just now that it's caused by a mod in my own client "No Chat Reports"

mdmanl avatar Nov 01 '24 15:11 mdmanl

i have the same problem right now

Are you using the mod "No Chat Reports"?

mdmanl avatar Nov 01 '24 15:11 mdmanl

Is No Chat Reports causing this, still considered a bug that needs to be fixed, or can I close this?

mdmanl avatar Nov 05 '24 14:11 mdmanl

image

Please give a working repro.

u9g avatar Nov 07 '24 00:11 u9g

image

Please give a working repro.

Repro is already in this thread. As stated before it's the client mod of No Chat Reports. From what it looks from your screenshot, you are playing around with the Paper plugin instead?

mdmanl avatar Nov 07 '24 13:11 mdmanl

image Please give a working repro.

Repro is already in this thread. As stated before it's the client mod of No Chat Reports. From what it looks from your screenshot, you are playing around with the Paper plugin instead?

I am using the client mod, No Chat Reports.

image

u9g avatar Nov 07 '24 15:11 u9g

image Please give a working repro.

Repro is already in this thread. As stated before it's the client mod of No Chat Reports. From what it looks from your screenshot, you are playing around with the Paper plugin instead?

I am using the client mod, No Chat Reports.

image

Fabric or Forge? No Chat Reports version? More info.

mdmanl avatar Nov 07 '24 20:11 mdmanl

image Please give a working repro.

Repro is already in this thread. As stated before it's the client mod of No Chat Reports. From what it looks from your screenshot, you are playing around with the Paper plugin instead?

I am using the client mod, No Chat Reports. image

Fabric or Forge? No Chat Reports version? More info.

Fabric, Latest for 1.21.1

u9g avatar Nov 07 '24 21:11 u9g

Have same problem at vanilla server 1.21.1 paper. Mineflayer get empty messages from server, but server sends correct messages (authorization messages)

The server allows you to log in with and without a license, most likely this is the problem

TheCaJlaT avatar Nov 22 '24 23:11 TheCaJlaT

I had the same issue and removing the 'No Chat Reports' Mod (as mdmanl said) on the client side fixed it for me

DangerStep avatar Dec 03 '24 06:12 DangerStep

I have found this allows me to get the message when the server is using no chat reports:

Image

jsonMsg.json.with[1][""]

BillBodkin avatar Feb 22 '25 16:02 BillBodkin