will the packet be sent when the target is attacked?
-
/// api_version=2
var script = registerScript({
name: "CPUE",
version: "1.0",
authors: ["KepuMxyecoc"]
});var CPacketUseEntity = Java.type('net.minecraft.network.play.client.CPacketUseEntity');
script.registerModule({
name: "CPUE",
category: "Combat",
description: "send CPUE"
}, function (module) {
module.on("attack", function (event) {
var target = event.getTargetEntity();
if (target !== null) {
var packet = new CPacketUseEntity(target);
mc.player.connection.sendPacket(packet);
}
});
}); -
Why not try it yourself? "attack" event runs BEFORE the entity was attacked. Depending on what you are doing it would make sense to use something else?