-
Why would you need a
onPacketSendevent? Packet names either start with a C or an S. Packets whose name begins with a C are client packets, those that begin with an S are server packets.@Senk-Ju said in onPlaceBlock , onSendPacket event:
Why would you need a
onPacketSendevent? Packet names either start with a C or an S. Packets whose name begins with a C are client packets, those that begin with an S are server packets.i mean i want to execute sth when sending a packet, example:
this.onSendPacket = function(event) { if(event.sendPacket() instanceof C03PacketPlayer) { Chat.print("you send a c03 packet!") } } -
@Senk-Ju said in onPlaceBlock , onSendPacket event:
Why would you need a
onPacketSendevent? Packet names either start with a C or an S. Packets whose name begins with a C are client packets, those that begin with an S are server packets.i mean i want to execute sth when sending a packet, example:
this.onSendPacket = function(event) { if(event.sendPacket() instanceof C03PacketPlayer) { Chat.print("you send a c03 packet!") } }@ChocoPie_isme rip brian cels v2
now i don even hvae brian cels enough to tyoep pwoperly
-
Why not do it like this?
module.on("packet", function(event) { var packet = event.getPacket(); if (packet instanceof Java.type("net.minecraft.network.play.client.C03PacketPlayer")) { Chat.print("you send a c03 packet!"); } });@Senk-Ju said in onPlaceBlock , onSendPacket event:
Why not do it like this?
module.on("packet", function(event) { var packet = event.getPacket(); if (packet instanceof Java.type("net.minecraft.network.play.client.C03PacketPlayer")) { Chat.print("you send a c03 packet!"); } });i thought the code will be execute when i RECEIVE (not send) a packet?
-
In the documentation it says the following:
Event Name Has event data? Description packet Yes Called every time a packet is processed. Packet event
Method Description Type eventData.getPacket() Returns the packet which triggered this event. Packet event.cancelEvent() Cancels the event. void Example: var C00Handshake = Java.type("net.minecraft.network.handshake.client.C00Handshake"); ... module.on("packet", function(eventData) { var packet = eventData.getPacket(); if (packet instanceof C00Handshake) { Chat.print("Cancelling handshake."); eventData.cancelEvent(); } }); -
@Senk-Ju said in onPlaceBlock , onSendPacket event:
Why not do it like this?
module.on("packet", function(event) { var packet = event.getPacket(); if (packet instanceof Java.type("net.minecraft.network.play.client.C03PacketPlayer")) { Chat.print("you send a c03 packet!"); } });i thought the code will be execute when i RECEIVE (not send) a packet?
-
In the documentation it says the following:
Event Name Has event data? Description packet Yes Called every time a packet is processed. Packet event
Method Description Type eventData.getPacket() Returns the packet which triggered this event. Packet event.cancelEvent() Cancels the event. void Example: var C00Handshake = Java.type("net.minecraft.network.handshake.client.C00Handshake"); ... module.on("packet", function(eventData) { var packet = eventData.getPacket(); if (packet instanceof C00Handshake) { Chat.print("Cancelling handshake."); eventData.cancelEvent(); } });@Senk-Ju
My Opinion:
CxxPacket only sends by Client and won't receive from Server
SxxPacket only receives from Server -
As for "onPlaceBlock", I think you can check C08PacketPlayerBlockPlacement in onPacket.
(I don't code with mcp918 so If it's wrong way plz remind me, thanks) -
This post is deleted!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login