soundEffectHeard
event is not emitted in 1.20.4
#3329
Labels
possible bug
Stage1
just created by someone new to the project, we don't know yet if it deserves an implementation / a f
Versions
Detailed description of a problem
I'm developing a bot that can hear something from Minecraft. But I found
soundEffectHeard
event can not be emitted anyway. The following code snippet does not output the correspondingsoundName
at all.However, the
hardcodedSoundEffectHeard
event works well. The code snippet is as follows.What did you try yet?
Edit the source code and test
I have tried to edit the source code in
mineflayer/lib/plugins/sound.js
at line 7 to see what will happen.Unfortunately,
console.log('Test')
does not output anything, inferring that this function is not being called for some reason.Run command in Minecraft to play sounds
I also tried to run the
/playsound
command in Minecraft,and I can hear the sound being played correctly in Minecraft.
However, there is still no output of the corresponding
soundName
in JavaScript console.Maybe because
namedSound
or this packet from server is not received correctly?What I noticed at [Protocol - wiki.vg](https://wiki.vg/Protocol#Sound_Effect) is that
soundname
presents only if the sound ID is 0.So I ran the command
The server told me that "Played sound minecraft:0 to 2 players" but there is still no output of the corresponding
soundName
in JavaScript console.Your current code
This is my code and it doesn't have any warnings or errors when I running it.
Expected behavior
I want to be able to get
soundName
,position
values from emittedsoundEffectHeard
event since I need to judge the sound source and position to set my bot's face orientation. While usinghardcodedSoundEffectHeard
event might work, it's not a good idea due to the sound ID might change for different Minecraft version.Additional context
/playsound 0 neutral @a
in Minecraft does not emithardcodedSoundEffectHeard
event.The text was updated successfully, but these errors were encountered: