ProtocolLib issues

Discussion in 'Plugin Development' started by Tim_M, Oct 30, 2021.

  1. Offline

    Tim_M

    I'm making a custom mob creator, in this creator you can set the sounds that the mobs make. The problem lies within actually playing those sounds. As a test I tried listening for a packet but it doesn't work, here's the code:
    Code:
    public void listenPackets()
    {
       ProtocolLibrary.getProtocolManager().addPacketListener(
       new PacketAdapter(Main.instance, ListenerPriority.NORMAL, PacketType.Play.Server.ENTITY_SOUND)
       {
       @Overridepublic void onPacketSending(PacketEvent event) {
       if (event.getPacketType() == PacketType.Play.Server.ENTITY_SOUND)
       {
          Main.instance.console.sendMessage("a");
       }
    }
    
    The weird this is that only ENTITY_SOUND doesn't work, NAMED_SOUND packet works perfectly fine and prints "a", how can I fix this?[/CODE]
     

Share This Page