ProtocolLib Packets not sending

Discussion in 'Plugin Development' started by Shadow_tingBRO, Apr 5, 2020.

Thread Status:
Not open for further replies.
  1. I just started using ProtocolLib's API and was wondering what i'm doing wrong here, sorry if this is the wrong place to ask:

    Code:
    /**
    * Stops all the sounds for the player, but its not working for some reason.
    */
    public void stopSounds(SoundCategory c) {
            ProtocolManager manager = ProtocolLibrary.getProtocolManager();
            PacketContainer con = manager.createPacket(PacketType.Play.Server.STOP_SOUND);
            con.getSoundCategories().writeSafely(0, c);
            try {
                manager.sendServerPacket(<player>, con);
            } catch (InvocationTargetException e) {
                e.printStackTrace();
            }
            System.out.println("sent packet "+con.toString());//this sends to console, and shows the correct packet.
        }
    
     
Thread Status:
Not open for further replies.

Share This Page