Solved [Protocol Lib] - Block specific sounds?

Discussion in 'Plugin Development' started by spurkle, Aug 23, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    spurkle

    Hi.

    I am really new to the Protocol Lib and trying to make something.

    I need to mute specific NPCs sounds. I know that you can completely remove a sound by using Named_Sound_Effect packet, but I need to block sounds that were made by the mobs with specific metadata, how would I be able to do it?

    Is there any way to get an entity that has made the sound?
     
  2. Offline

    Zombie_Striker

    @spurkle
    Listen for packet "Named Sound Effect". You can see all the data in the packet here:
    http://wiki.vg/Protocol#Named_Sound_Effect

    To remove a sound effect, listen for that packet. If the location of the effect/ entity that caused that effect has the meta data, cancel the packetevent

    .
    [edit] Sort of. Get the XYZ of the packet. After that, compare that location to the location of all the entities in the map. If an entity has the same XYZ location, then that entity is most likely the one that caused the effect.
     
    spurkle likes this.
  3. Offline

    spurkle

    Thanks for your answer.

    I came to a solution by muting all sounds start start with mob. name and have volume of 1F.

    This allows me to play custom mob sounds with float of 0.99F, and keep mob step sounds (They play at 0.15F).

    [​IMG]
     
Thread Status:
Not open for further replies.

Share This Page