Source SRC AutoFish For Minecraft| Free

CrazyTrap

Newbie
Newbie
Newbie
Newbie
Status
Offline
Joined
Jul 18, 2023
Messages
707
Reaction score
3
Welcome, builders and adventurers, to a sanctuary of Minecraft resources that will shape your gameplay like never before! Delve into our treasure trove of meticulously curated mods, skins, and more, each designed to enhance your gaming experience. Whether you seek to construct awe-inspiring structures or embark on daring quests, our handpicked selection will cater to your every need. Embrace the possibilities that await you in this pixelated realm, and let your imagination run wild!

1643890389_63-phonoteka-org-p-zagruzochnii-fon-mainkraft-76.png

AutoFish:​

Code:
private static Setting<Mode> mode = new Setting<>("Mode", Mode.BOUNCE);
    private static Setting<Boolean> cast = new Setting<>("Cast", true);

    private enum Mode {
        BOUNCE, SPLASH, BOTH
    }

    public AutoFish() {
        super("AutoFish", Category.MISC, "AutoCaster");
    }

    private boolean shouldCatch = false;
    private boolean shouldReCast = false;
    private Timer timer = new Timer();

    @EventTarget
    public void onPacketReceive(PacketEvent.Receive event) {
        if (event.getPacket() instanceof SPacketSoundEffect) {
            if (((SPacketSoundEffect) event.getPacket()).getSound().getSoundName().toString().toLowerCase().contains("entity.bobber.splash")) {
                if (!shouldReCast && staticCheck() && mode.getValue() != Mode.BOUNCE) {
                    shouldCatch = true;
                    timer.reset();
                }
            }
        }
    }

    @Override
    public String getExtraInfo() {
        return mode.getValue().toString().charAt(0) + mode.getValue().toString().substring(1).toLowerCase();
    }

    @EventTarget
    public void onPlayerUpdate(PlayerUpdateEvent event) {
        if (mc.player.getHeldItemMainhand().getItem() != Items.FISHING_ROD) {
            timer.reset();
            shouldCatch = false;
            shouldReCast = false;
            return;
        }

        if (mc.player.fishEntity == null) {
            if (shouldReCast) {
                if (timer.hasPassed(450)) {
                    ((IMinecraft) mc).invokeRightClickMouse();
                    timer.reset();
                    shouldCatch = false;
                    shouldReCast = false;
                }
            } else if (cast.getValue() && timer.hasPassed(4500)) {
                ((IMinecraft) mc).invokeRightClickMouse();
                timer.reset();
                shouldCatch = false;
                shouldReCast = false;
            }
        } else if (staticCheck() && waterCheck()) {
            if (shouldCatch) {
                if (timer.hasPassed(350)) {
                    ((IMinecraft) mc).invokeRightClickMouse();
                    timer.reset();
                    shouldCatch = false;
                    shouldReCast = true;
                }
            } else {
                if (mode.getValue() != Mode.SPLASH && bounceCheck()) {
                    timer.reset();
                    shouldCatch = true;
                    shouldReCast = false;
                }
            }
        } else if (staticCheck()) {
            ((IMinecraft) mc).invokeRightClickMouse();
            timer.reset();
            shouldCatch = false;
            shouldReCast = false;
        }
    }

    private boolean bounceCheck() {
        if (mc.player.fishEntity == null || !waterCheck()) return false;
        return Math.abs(mc.player.fishEntity.motionY) > 0.05;
    }

    private boolean staticCheck() {
        if (mc.player.fishEntity == null || mc.player.fishEntity.isAirBorne || shouldReCast) return false;
        return Math.abs(mc.player.fishEntity.motionX) + Math.abs(mc.player.fishEntity.motionZ) < 0.01;
    }

    private boolean waterCheck() {
        if (mc.player.fishEntity == null || mc.player.fishEntity.isAirBorne) return false;
        BlockPos pos = mc.player.fishEntity.getPosition();
        return mc.world.getBlockState(pos).getBlock() instanceof BlockLiquid || mc.world.getBlockState(pos.down()).getBlock() instanceof BlockLiquid;
    }
}
 
Top