can you show me the event file looks like? like getPacket method.go to network manager, sendpacket method, go to the end of method and write packet receive event and call it.
the method to check for invoming packets is in networkmanager under the method channelRead0 and for outgoing packets its in nethandlerplayclient under the method addToSendQueueHow to make Packet Receive event?
This is the best forum in the worldgo to network manager, sendpacket method, go to the end of method and write packet receive event and call it.
protected void channelRead0(ChannelHandlerContext p_channelRead0_1_, Packet<?> p_channelRead0_2_) throws Exception {
if (this.channel.isOpen()) {
EventReceivePacket eventReceivePacket = new EventReceivePacket(p_channelRead0_2_);
public void sendPacket(Packet<?> packetIn) {
EventSendPacket eventSendPacket = new EventSendPacket(packetIn);
yes, i forgot for this. i create events about a half year ago.@SageDEV got something mixed up here
As @teqhs wrote there is a method "channelRead0" in the NetworkManager class that is the method you are looking for. It is executed when a packet comes in.
Java:protected void channelRead0(ChannelHandlerContext p_channelRead0_1_, Packet<?> p_channelRead0_2_) throws Exception { if (this.channel.isOpen()) { EventReceivePacket eventReceivePacket = new EventReceivePacket(p_channelRead0_2_);
Also there is a method "sendPacket" which is executed when a packet is sent.
Java:public void sendPacket(Packet<?> packetIn) { EventSendPacket eventSendPacket = new EventSendPacket(packetIn);
That is packet send method not recieve.go to network manager, sendpacket method, go to the end of method and write packet receive event and call it.