ProtocolLib - PacketListener doesn't call

Discussion in 'Spigot Plugin Development' started by NiceDev, Jun 9, 2015.

  1. Hey,
    is the sound "game.potion.smash" client-side? My Packet-Listener isn't calling, when I play this sound. How can I cancel that sound? (ProtocolLib)

    Jan
     
  2. Show us your code
     
  3. Code (Text):

            ProtocolLibrary.getProtocolManager().addPacketListener(
                    new PacketAdapter(this, ListenerPriority.NORMAL, PacketType.Play.Server.NAMED_SOUND_EFFECT) {
                        @Override
                        public void onPacketSending(PacketEvent event) {
                            event.setCancelled(true);
                            System.out.println(event.getPacket().getStrings().read(0));
                         
                        }
                    });
     
    All sound are cancelled, but the Splash-Sound..
     
  4. @NiceDev iirc the sound was embedded in the visual effect.