Hello Bukkiteers! I'm currently working on a dungeon plugin, and I'm having a problem: The dungeons are very close-built and so the mobs are standing everywhere, and they are making a heavy noise! So I would like to remove the sounds the mobs are making when they are inactive. Any ideas how to do that? I don't want to disable ALL sounds, just those sounds. Please help me!
Well, nevermind. I already found out how to use it. But there does not seem to be an option for getting the "reason" of the sound, but just which sound is played. That would cause that I can't play the sounds the event causes in any other context.
ok, I will try it. Ok, I now tried to use the stuff that is on the support website of ProtocolLib(http://dev.bukkit.org/bukkit-plugins/protocollib/pages/tutorial/), but how am I supposed to check whether the sound was caused by something like InactiveMob or something similar? The only possibility is using NAMED_SOUND_EFFECT, which is also fired if the player e.g hits the mob. So that would be disabled, too. Please help me! EDIT by Moderator: merged posts, please use the edit button instead of double posting.
It's fired if there are sounds played. Find however you get the name of the sound. Isn't there a Packet#getStrings() or something? Figure out which one is the sound effect name, and then compare it with a list of sounds you want to get rid of.
Thanks for your answer Garris0n, I think I have understood the matter. But is there a possibility to see all the options for Packet.getStrings() ? I really have no idea with which stuff I have to check. YES! I found it https://github.com/SirCmpwn/Craft.Net/blob/master/source/Craft.Net.Common/SoundEffect.cs EDIT by Moderator: merged posts, please use the edit button instead of double posting.
You're better off with this one, it's guaranteed to be up-to-date with CraftBukkit (because it is CraftBukkit). https://github.com/Bukkit/CraftBukk...n/java/org/bukkit/craftbukkit/CraftSound.java