There's how far I got:
var WrappedListener = Java.extend((Java.type('net.ccbluex.liquidbounce.event.Listenable')), (Java.type('java.util.function.Consumer')), {
handleEvents: function() { return module[0].state },
accept: function(e) {
e instanceof PacketEvent && LiquidBounce.INSTANCE.eventManager.callEvent(new WrappedPacketEvent(e.getPacket().wrapped));
}
});
function WrappedPacketEvent(packet) {
var isCancelled;
this.isCancelled = function() isCancelled;
this.cancelEvent = function() {
isCancelled = true;
}
this.getPacket = function() packet;
}