Hi, just wondering if there are any events that are triggered once a packet is sent/recieved?
There are many things that I would like to do with this functionality, such as measuring a servers tickrate based on counting the frequency of server update packets.
If these events do not exist, is there another way to do it like each tick seeing each packet that is going to be sent during that tick?
Thanks
For anyone else looking for this in the future, create mixins for net.minecraft.network.NetworkManager like so:
@Inject(method = "sendPacket(Lnet/minecraft/network/Packet;)V", at = @At("HEAD"), cancellable = true)
private void onSendPacket(Packet<?> packet, CallbackInfo callbackInfo)
{
//System.out.println("Packet Sent: " + packet.toString());
PacketSent event = new PacketSent(packet);
MinecraftForge.EVENT_BUS.post(event);
if (event.isCanceled() && callbackInfo.isCancellabl