Reading packet data?
-
When breaking a carrot I capture two packets with the packet event, which I presume are the start breaking and end breaking packets.
I need a way to differentiate between the start breaking and the end breaking packet. Is there a way to read the packet's contents?var packetDig = Java.type("net.minecraft.network.play.client.C07PacketPlayerDigging"); module.on("packet", function(eventData) { var packet = eventData.getPacket(); if (packet instanceof packetDig) { Chat.print("Data: " + eventData); //eventData.cancelEvent(); } }); -
When breaking a carrot I capture two packets with the packet event, which I presume are the start breaking and end breaking packets.
I need a way to differentiate between the start breaking and the end breaking packet. Is there a way to read the packet's contents?var packetDig = Java.type("net.minecraft.network.play.client.C07PacketPlayerDigging"); module.on("packet", function(eventData) { var packet = eventData.getPacket(); if (packet instanceof packetDig) { Chat.print("Data: " + eventData); //eventData.cancelEvent(); } }); -
I've also come across a solution for this.
Although I'm not quite sure if this is working properly because when breaking a carrot, I detect two packets both with the action of START_DESTROY_BLOCK, and nothing else.
For now this seems to suffice.
var packetDig = Java.type("net.minecraft.network.play.client.C07PacketPlayerDigging"); module.on("packet", function(eventData) { var packet = eventData.getPacket(); if (packet instanceof packetDig) { Chat.print("Stat: " + packet.getStatus()); Chat.print("Pos: " + packet.getPosition()); Chat.print("Facing: " + packet.getFacing()); //eventData.cancelEvent(); } });
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