public void attack() {
if (mc.player.isOnGround()) {
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.Full(mc.player.getX(), mc.player.getY() + 1e-8, mc.player.getZ(), mc.player.getYaw(), mc.player.getPitch(), false));
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.Full(mc.player.getX(), mc.player.getY() - 1e-9, mc.player.getZ(), mc.player.getYaw(), mc.player.getPitch(), false));
if (!mc.player.isUsingItem()) {
mc.player.networkHandler.sendPacket(new PlayerInteractItemC2SPacket(Hand.OFF_HAND, 0));
mc.interactionManager.stopUsingItem(mc.player);
}
} else {
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.Full(mc.player.getX(), mc.player.getY() - 1e-9, mc.player.getZ(), mc.player.getYaw(), mc.player.getPitch(), false));
if (!mc.player.isUsingItem()) {
mc.player.networkHandler.sendPacket(new PlayerInteractItemC2SPacket(Hand.OFF_HAND, 0));
mc.interactionManager.stopUsingItem(mc.player);
}
}
}