Stop entity sound?

Discussion in 'Plugin Development' started by XXDXM_hippiexX, Sep 27, 2017.

Tags:
  1. XXDXM_hippiexX

    XXDXM_hippiexX New Member

    Jul 1, 2017
    5
    1
    3
    Male
    I wish to stop certain mobs from making any noise at all. I've been looking around the nukkit src but cant find where the mobs sound is defined, thought I might be able to override a method but no luck finding it. Also tried using DataPacketSendEvent but still cant find where mob sound is sent (which packet?). I would prefer to override a method if possible...that is if mob sounds are not client side. Any help?
     
  2. pkt77

    pkt77 New Member

    Aug 26, 2017
    5
    1
    3
    Male
  3. XXDXM_hippiexX

    XXDXM_hippiexX New Member

    Jul 1, 2017
    5
    1
    3
    Male
    Late response but neither seemed to work..
    Code:
    @EventHandler(ignoreCancelled = true)
        public void onPacketSent(DataPacketSendEvent event) {
            DataPacket packet = event.getPacket();
            if(packet instanceof LevelSoundEventPacket){
                Api.log("LevelSoundPacket fired.");
            }else
            if(packet instanceof PlaySoundPacket){
                Api.log("PlaySoundPacket fired.");
            }
        }
    Didn't show anything on the log as the 20 mobs around me made an awful symphony...