Welcome on MasterOf13FPS! MasterOf13FPS

Register today or sign up if you are already a member and never miss any cool content again :)

Packet Receive Event Help

go to network manager, sendpacket method, go to the end of method and write packet receive event and call it.
 
go to network manager, sendpacket method, go to the end of method and write packet receive event and call it.
can you show me the event file looks like? like getPacket method.
 
How to make Packet Receive event?
the method to check for invoming packets is in networkmanager under the method channelRead0 and for outgoing packets its in nethandlerplayclient under the method addToSendQueue
 
go to network manager, sendpacket method, go to the end of method and write packet receive event and call it.
This is the best forum in the world
 
Last edited:
@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);
 
@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);
yes, i forgot for this. i create events about a half year ago.
 
shape1
shape2
shape3
shape4
shape5
shape6
Back
Top