I noticed there the wasn't a lot of information online about catching and modifying vanilla packets in minecraft, so I decided to make an event myself for future modders. Unfortunately I'm not a coding mastermind, so I apologize for any poor code.
Only the files in the packetevent package are needed, the rest are an example of how to use the event. An instance of the channelhandlerinput class must be added to the eventbus for the packet event to work.
A compiled jar file is added if you wish to add it to your minecraft forge for some reason.
You can use this however you like just give credit :)
Helpful tip: Server packets are classes that start with a 'S' Client packets are classes that start with a 'C'