var script = registerScript({
    name: "SuperVelocity",
    version: "1.0",
    authors: ["Anonzme"]
});

var C0BPacketEntityAction = Java.type("net.minecraft.network.play.client.C0BPacketEntityAction");
var EntityLivingBase = Java.type("net.minecraft.entity.EntityLivingBase");

script.registerModule({
  name: "SuperVelocity",
  description: "Velocity++",
  category: "Combat",
}, function(module) {
    module.on("attack", function(event) {
        var entity = event.getTargetEntity();
        if (entity instanceof EntityLivingBase) {
            if (mc.thePlayer.isSprinting())
                mc.thePlayer.setSprinting(false);
                    
            mc.getNetHandler().addToSendQueue(new C0BPacketEntityAction(mc.thePlayer, C0BPacketEntityAction.Action.START_SPRINTING));
                    
            mc.thePlayer.setSprinting(true);
            mc.thePlayer.serverSprintState = true;
        }
    });
});
