private boolean hs;
int ticks;
private long lastHsTime;
@Override public void onToggle() {
hs = false;
ticks = 0;
lastHsTime = System.currentTimeMillis();
}
@Handler public Listener<PacketEvent.Send> packeEventSend = new Listener<>(PacketEvent.Send.class, event -> {
if (event.getPacket() instanceof CPacketPlayerDigging){
CPacketPlayerDigging packet = (CPacketPlayerDigging) event.getPacket();
if (packet.getAction() == CPacketPlayerDigging.Action.RELEASE_USE_ITEM){
ItemStack handStack = mc.player.getHeldItem(EnumHand.MAIN_HAND);
if (!handStack.isEmpty() && handStack.getItem() != null && handStack.getItem() instanceof ItemBow) {
if (System.currentTimeMillis() - lastHsTime >= time * 1000 ) {
hs = true;
lastHsTime = System.currentTimeMillis();
mc.player.connection.sendPacket(new CPacketEntityAction(mc.player, CPacketEntityAction.Action.START_SPRINTING));
for ( int index = 0; index < spoof * 10; ++index ) {
mc.player.connection.sendPacket(new CPacketPlayer.Position(mc.player.posX, mc.player.posY + 1e-5, mc.player.posZ, false));
mc.player.connection.sendPacket(new CPacketPlayer.Position(mc.player.posX, mc.player.posY - 1e-5, mc.player.posZ, true));
}
hs = false;
}
}
}
}
});
}