diff --git a/src/main/java/me/zeroeightsix/kami/module/modules/combat/FastBow.java b/src/main/java/me/zeroeightsix/kami/module/modules/combat/FastBow.java new file mode 100644 index 00000000..75bc59f3 --- /dev/null +++ b/src/main/java/me/zeroeightsix/kami/module/modules/combat/FastBow.java @@ -0,0 +1,25 @@ +package me.zeroeightsix.kami.module.modules.combat; + +import me.zeroeightsix.kami.module.Module; +import net.minecraft.network.play.client.CPacketPlayerDigging; +import net.minecraft.network.play.client.CPacketPlayerTryUseItem; +import net.minecraft.util.math.BlockPos; + +/** + * Author Seth 4/30/2019 @ 4:27 AM. + *
+ * see github.com/seppukudevelopment/seppuku + */ +@Module.Info(name = "FastBow", description = "Fast Bow Release", category = Module.Category.COMBAT) +public class FastBow extends Module { + + @Override + public void onUpdate() { + if (mc.player.inventory.getCurrentItem().getItem() instanceof net.minecraft.item.ItemBow && + mc.player.isHandActive() && mc.player.getItemInUseMaxCount() >= 3) { + mc.player.connection.sendPacket(new CPacketPlayerDigging(CPacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, mc.player.getHorizontalFacing())); + mc.player.connection.sendPacket(new CPacketPlayerTryUseItem(mc.player.getActiveHand())); + mc.player.stopActiveHand(); + } + } +}