ProtocilLib is a spigot plugin that provides an API that allows "simplified" access to the minecraft protocol
Protocollib is a library for modifying/creating packets send to/received from the player. (Compatibility with all versions - 1.8 -> 1.5) When you need to modify incoming and outgoing packets or to inject custom packets into the stream. (Directly from their plugin page.) Modifying/Listening for packets easily.
Take a look at this link: https://github.com/dmulloy2/ProtocolLib/wiki/Packet-listeners-and-adapters and the readme of this: https://github.com/dmulloy2/ProtocolLib Examples: https://www.programcreek.com/java-api-examples/?api=com.comphenix.protocol.ProtocolLibrary