Подпишитесь на наш Telegram-канал, чтобы всегда быть в курсе важных обновлений! Перейти

Вопрос Silent Killaura

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
22 Мар 2022
Сообщения
395
Реакции
8
Я начал делать киллауру и делаю её уже почти полторы недели и не понимаю как сделать silent ротации что бы от первого лица всё было норм но не флагало с ними и когда у меня даже что то получалось было такое что киллаура отказывалась бить если я не смотрю на цель, и подобные другие баги, грок или другие нейросети тоже делают какащке и я уже забил на них болт. Очень нуждаюсь в помощи


Код:
Expand Collapse Copy
package ru.prodlasio.feature.implement.combat;

import com.google.common.eventbus.Subscribe;
import lombok.Getter;
import net.minecraft.block.Blocks;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.decoration.ArmorStandEntity;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.entity.mob.MobEntity;
import net.minecraft.entity.passive.AnimalEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket;
import net.minecraft.network.packet.c2s.play.CloseHandledScreenC2SPacket;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import net.minecraft.network.packet.c2s.play.UpdateSelectedSlotC2SPacket;
import net.minecraft.screen.slot.SlotActionType;
import net.minecraft.util.Hand;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import ru.prodlasio.events.impl.EventHud;
import ru.prodlasio.events.impl.EventRender3D;
import ru.prodlasio.events.impl.EventUpdate;
import ru.prodlasio.feature.Category;
import ru.prodlasio.feature.Feature;
import ru.prodlasio.feature.FeatureInfo;
import ru.prodlasio.feature.implement.combat.utils.AuraUtil;
import ru.prodlasio.feature.settings.impl.*;
import ru.prodlasio.helper.IMinecraft;
import ru.prodlasio.helper.main.manager.friend.FriendManager;
import ru.prodlasio.helper.main.render.RenderHelper;
import ru.prodlasio.helper.main.render.TargetDraw;
import ru.prodlasio.helper.other.player.InventoryHelper;
import ru.prodlasio.helper.other.player.PlayerHandler;

import java.awt.*;
import java.util.Comparator;
import java.util.List;
import java.util.Random;
import java.util.concurrent.CopyOnWriteArrayList;

import static ru.prodlasio.feature.implement.combat.utils.AuraUtil.*;

@FeatureInfo(name = "KillAura", category = Category.COMBAT, desc = "Автоматически атакует сущности с продвинутыми обходами античитов")
public class Aura extends Feature {
    public Aura() {
        add(fov, attackSettings, nohitwnen, renderFov, sortMode, targets, maxCPS, minCPS, maxTurnSpeed, failRate,
                ignoreInvisible, ignoreNewlySpawned, range, silentAim, movementAdjustLevel, rotationMode, rotationType,
                useBypassPackets, critMode, visualRot, horizontalCollision);
    }

    // Настройки
    public final SliderSetting fov = new SliderSetting("Угол обзора", 180F, 30F, 360F, 1F);
    public final ModeListSetting attackSettings = new ModeListSetting("Настройки атаки",
            "Ломать щит", "Только криты", "Бить через стены", "Сброс спринта", "1.8 пвп");
    public final ModeListSetting nohitwnen = new ModeListSetting("Не бить когда",
            "Ешь", "Открыто меню");
    private final ModeSetting sortMode = new ModeSetting("Режим сортировки",
            "Адаптивный", "Дистанция", "Здоровье", "Прочность брони", "Наводка");
    private static final ModeListSetting targets = new ModeListSetting("Таргеты",
            "Игроки", "Невидимые", "Голые", "Тиммейты", "Животные", "Мобы");
    public final BooleanSetting renderFov = new BooleanSetting("Рисовать FOV");
    public final SliderSetting maxCPS = new SliderSetting("Макс CPS", 20F, 1F, 30F, 1F);
    public final SliderSetting minCPS = new SliderSetting("Мин CPS", 10F, 1F, 20F, 1F);
    public final SliderSetting maxTurnSpeed = new SliderSetting("Макс скорость поворота", 90F, 10F, 180F, 1F);
    public final SliderSetting failRate = new SliderSetting("Шанс пропуска атаки", 5F, 0F, 20F, 1F);
    public final BooleanSetting ignoreInvisible = new BooleanSetting("Игнорировать невидимых", true);
    public final BooleanSetting ignoreNewlySpawned = new BooleanSetting("Игнорировать новых игроков", true);
    public final SliderSetting range = new SliderSetting("Дальность атаки", 4.2F, 3.0F, 6.0F, 0.1F);
    public final BooleanSetting silentAim = new BooleanSetting("Бесшумный прицел", true);
    public final SliderSetting movementAdjustLevel = new SliderSetting("Уровень корректировки движения", 0.5F, 0.0F, 1.0F, 0.1F);
    private final ModeSetting rotationMode = new ModeSetting("Режим ротации", "PerAttack", "Continuous");
    private final ModeSetting rotationType = new ModeSetting("Тип ротации", "Классический", "Продвинутый", "Spooky");
    public final BooleanSetting useBypassPackets = new BooleanSetting("Использовать обходные пакеты");
    private final ModeSetting critMode = new ModeSetting("Режим критов", "Легит", "Всегда", "Воздух");
    public final BooleanSetting visualRot = new BooleanSetting("От первого лица", false);
    public final BooleanSetting horizontalCollision = new BooleanSetting("Учитывать горизонтальную коллизию", true);

    @Getter
    LivingEntity target;

    private int attackTimer = 0;
    private final Random random = new Random();
    private RotationMode currentRotationMode;

    public interface RotationMode {
        void update(LivingEntity target);
        float getYaw();
        float getPitch();
    }

    public class RotationAnimation {
        private float currentYaw;
        private float currentPitch;
        private float targetYaw;
        private float targetPitch;
        private int yawSpeed;
        private int pitchSpeed;

        public RotationAnimation() {
            currentYaw = 0.0f;
            currentPitch = 0.0f;
        }

        public void setTarget(float yaw, float pitch, int yawSpeed, int pitchSpeed) {
            this.targetYaw = yaw;
            this.targetPitch = pitch;
            this.yawSpeed = yawSpeed;
            this.pitchSpeed = pitchSpeed;
        }

        public void update() {
            if (mc.player == null) {
                return;
            }

            if (currentYaw == 0.0f && currentPitch == 0.0f) {
                currentYaw = mc.player.getYaw();
                currentPitch = mc.player.getPitch();
            }

            float deltaYaw = MathHelper.wrapDegrees(targetYaw - currentYaw);
            float deltaPitch = targetPitch - currentPitch;

            float yawStep = Math.signum(deltaYaw) * Math.min(Math.abs(deltaYaw), yawSpeed);
            float pitchStep = Math.signum(deltaPitch) * Math.min(Math.abs(deltaPitch), pitchSpeed);

            currentYaw += yawStep;
            currentPitch += pitchStep;

            if (Math.abs(deltaYaw) <= yawSpeed && Math.abs(deltaPitch) <= pitchSpeed) {
                currentYaw = targetYaw;
                currentPitch = targetPitch;
            }
        }

        public float getYaw() {
            return currentYaw;
        }

        public float getPitch() {
            return currentPitch;
        }
    }

    public class ClassicRotation implements RotationMode {
        private final RotationAnimation rotAnim = new RotationAnimation();

        @Override
        public void update(LivingEntity target) {
            if (mc.player == null) {
                return;
            }
            if (target == null) {
                rotAnim.setTarget(mc.player.getYaw(), mc.player.getPitch(), (int) (maxTurnSpeed.get() / 20F), (int) (maxTurnSpeed.get() / 20F));
                rotAnim.update();
                return;
            }
            float[] desired = getDesiredRotations(target);
            float targetYaw = desired[0];
            float targetPitch = desired[1];
            int yawSpeed = (int) (maxTurnSpeed.get() / 20F);
            int pitchSpeed = (int) (maxTurnSpeed.get() / 20F);
            rotAnim.setTarget(targetYaw, targetPitch, yawSpeed, pitchSpeed);
            rotAnim.update();
        }

        @Override
        public float getYaw() {
            return rotAnim.getYaw();
        }

        @Override
        public float getPitch() {
            return rotAnim.getPitch();
        }
    }

    public class AdvancedRotation implements RotationMode {
        private final RotationAnimation rotAnim = new RotationAnimation();

        @Override
        public void update(LivingEntity target) {
            if (mc.player == null) {
                return;
            }
            if (target == null) {
                rotAnim.setTarget(mc.player.getYaw(), mc.player.getPitch(), (int) (maxTurnSpeed.get() / 20F), (int) (maxTurnSpeed.get() / 20F));
                rotAnim.update();
                return;
            }
            Vec3d predictedPos = predictTargetPosition(target);
            float[] desired = getRotationsFromPos(predictedPos);
            float targetYaw = desired[0];
            float targetPitch = desired[1];
            int yawSpeed = (int) (maxTurnSpeed.get() / 20F);
            int pitchSpeed = (int) (maxTurnSpeed.get() / 20F);
            rotAnim.setTarget(targetYaw, targetPitch, yawSpeed, pitchSpeed);
            rotAnim.update();
        }

        @Override
        public float getYaw() {
            return rotAnim.getYaw();
        }

        @Override
        public float getPitch() {
            return rotAnim.getPitch();
        }

        private Vec3d predictTargetPosition(LivingEntity target) {
            Vec3d velocity = target.getVelocity();
            Vec3d pos = target.getBoundingBox().getCenter();
            return pos.add(velocity.multiply(0.5));
        }

        private float[] getRotationsFromPos(Vec3d pos) {
            if (mc.player == null) {
                return new float[]{0.0f, 0.0f};
            }
            Vec3d playerPos = mc.player.getEyePos();
            double deltaX = pos.x - playerPos.x;
            double deltaY = pos.y - playerPos.y;
            double deltaZ = pos.z - playerPos.z;
            double distanceXZ = Math.sqrt(deltaX * deltaX + deltaZ * deltaZ);
            float yaw = (float) Math.toDegrees(Math.atan2(deltaZ, deltaX)) - 90.0F;
            float pitch = (float) -Math.toDegrees(Math.atan2(deltaY, distanceXZ));
            return new float[]{yaw, pitch};
        }
    }

    // Spooky режим ротации
    public class SpookyRotation implements RotationMode {
        private final RotationAnimation rotAnim = new RotationAnimation();

        @Override
        public void update(LivingEntity target) {
            if (mc.player == null) {
                return;
            }
            if (target == null) {
                rotAnim.setTarget(mc.player.getYaw(), mc.player.getPitch(), (int) (maxTurnSpeed.get() / 20F), (int) (maxTurnSpeed.get() / 20F));
                rotAnim.update();
                return;
            }
            float[] desired = getDesiredRotations(target);
            float targetYaw = desired[0] + (random.nextFloat() - 0.5f) * 2.0f;
            float targetPitch = desired[1] + (random.nextFloat() - 0.5f) * 2.0f;
            int yawSpeed = (int) (maxTurnSpeed.get() / 15F);
            int pitchSpeed = (int) (maxTurnSpeed.get() / 15F);
            rotAnim.setTarget(targetYaw, targetPitch, yawSpeed, pitchSpeed);
            rotAnim.update();
        }

        @Override
        public float getYaw() {
            return rotAnim.getYaw();
        }

        @Override
        public float getPitch() {
            return rotAnim.getPitch();
        }
    }

    private float[] getDesiredRotations(LivingEntity entity) {
        if (mc.player == null) {
            return new float[]{0.0f, 0.0f};
        }
        Vec3d playerPos = mc.player.getEyePos();
        Vec3d targetPos = entity.getBoundingBox().getCenter();
        double deltaX = targetPos.x - playerPos.x;
        double deltaY = targetPos.y - playerPos.y;
        double deltaZ = targetPos.z - playerPos.z;
        double distanceXZ = Math.sqrt(deltaX * deltaX + deltaZ * deltaZ);
        float yaw = (float) Math.toDegrees(Math.atan2(deltaZ, deltaX)) - 90.0F;
        float pitch = (float) -Math.toDegrees(Math.atan2(deltaY, distanceXZ));
        float offset = 1.7f;
        yaw += (random.nextFloat() - 0.5f) * offset;
        pitch += (random.nextFloat() - 0.5f) * offset;
        return new float[]{yaw, pitch};
    }

    private RotationMode getRotationMode() {
        switch (rotationType.getSelected()) {
            case "Продвинутый":
                return new AdvancedRotation();
            case "Spooky":
                return new SpookyRotation();
            case "Классический":
            default:
                return new ClassicRotation();
        }
    }

    private boolean collideWith(Entity target) {
        if (mc.player == null || target == null || !horizontalCollision.isState()) {
            return false;
        }
        double distance = mc.player.getPos().distanceTo(target.getPos());
        return distance < 3;
    }

    @Subscribe
    public void onUpdate(EventUpdate e) {
        if (mc.player == null || mc.world == null) {
            return;
        }

        if (mc.player.isUsingItem() && nohitwnen.isSelected("Ешь")) {
            return;
        }
        if (mc.currentScreen != null && nohitwnen.isSelected("Открыто меню")) {
            return;
        }

        if (attackTimer > 0) {
            attackTimer--;
            return;
        }

        target = find();

        if (target == null) {
            if (silentAim.isState() && rotationMode.getSelected().equals("Continuous")) {
                currentRotationMode.update(null);
                float yaw = mc.player.getYaw();
                float pitch = currentRotationMode.getPitch();
                mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.LookAndOnGround(yaw, pitch, mc.player.isOnGround(), true));
            }
            return;
        }

        TargetDraw.tick();

        if (!autoCrit()) return;

        if (shieldBreaker(false)) {
            setAttackTimer();
            return;
        }

        float baseFov = this.fov.get();
        double fov = calculateFOVFromCamera(target) * 3;

        currentRotationMode.update(target);
        float yaw = currentRotationMode.getYaw();
        float pitch = currentRotationMode.getPitch();

        if (silentAim.isState() && rotationMode.getSelected().equals("Continuous")) {
            mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.LookAndOnGround(yaw, pitch, mc.player.isOnGround(), true));
        }

        if (!FriendManager.checkFriend(target.getName().getString())
                && (silentAim.isState() || Math.abs(fov) < baseFov)
                && mc.player.distanceTo(target) <= range.get()
                && mc.player.getAttackCooldownProgress(0.5f) >= 1.0f) {
            if (random.nextInt(100) < failRate.get()) {
                return;
            }
            if (random.nextInt(10) < 4) {
                yaw += (random.nextFloat() - 0.5f) * 3f;
                pitch += (random.nextFloat() - 0.5f) * 3f;
            }
            attack(target);
            setAttackTimer();
            TargetDraw.on();
        }
    }

    private void setAttackTimer() {
        float cps = minCPS.get() + random.nextFloat() * (maxCPS.get() - minCPS.get());
        int attackInterval = (int) (1000 / cps / 50);
        attackTimer = attackInterval + random.nextInt(3);
    }

    public void attack(Entity entity) {
        if (mc.player == null || mc.world == null) {
            return;
        }

        boolean sprinting = mc.player.isSprinting();
        boolean needToResetSprint = attackSettings.isSelected("Сброс спринта");

        float originalYaw = mc.player.getYaw();
        float originalPitch = mc.player.getPitch();

        currentRotationMode.update((LivingEntity) entity);
        float yaw = currentRotationMode.getYaw();
        float pitch = currentRotationMode.getPitch();

        boolean isColliding = collideWith(entity);

        if (silentAim.isState()) {
            if (rotationMode.getSelected().equals("PerAttack")) {
                mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.LookAndOnGround(yaw, pitch, mc.player.isOnGround(), true));
            }

            if (!mc.player.isSwimming() && sprinting && needToResetSprint) {
                mc.player.networkHandler.sendPacket(new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.STOP_SPRINTING));
                mc.player.setSprinting(false);
            }

            mc.interactionManager.attackEntity(mc.player, entity);
            mc.player.swingHand(Hand.MAIN_HAND);

            if (!mc.player.isSwimming() && sprinting && needToResetSprint) {
                mc.player.setSprinting(true);
                mc.player.networkHandler.sendPacket(new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.START_SPRINTING));
            }

            if (rotationMode.getSelected().equals("PerAttack")) {
                mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.LookAndOnGround(originalYaw, originalPitch, mc.player.isOnGround(), true));
            }

            if (visualRot.isState()) {
                mc.player.setYaw(yaw);
                mc.player.setPitch(pitch);
            }

            if (isColliding) {
                adjustMovementOnCollision(yaw);
            } else {
                adjustMovement(yaw);
            }
        } else {
            mc.player.setYaw(yaw);
            mc.player.setPitch(pitch);

            if (!mc.player.isSwimming() && sprinting && needToResetSprint) {
                mc.player.networkHandler.sendPacket(new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.STOP_SPRINTING));
                mc.player.setSprinting(false);
            }

            mc.interactionManager.attackEntity(mc.player, entity);
            mc.player.swingHand(Hand.MAIN_HAND);

            if (!mc.player.isSwimming() && sprinting && needToResetSprint) {
                mc.player.setSprinting(true);
                mc.player.networkHandler.sendPacket(new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.START_SPRINTING));
            }
        }
    }

    private void adjustMovement(float spoofedYaw) {
        if (mc.player == null) {
            return;
        }
        float deltaYaw = MathHelper.wrapDegrees(spoofedYaw - mc.player.getYaw());
        float forward = mc.player.input.movementForward;
        float sideways = mc.player.input.movementSideways;
        float adjustFactor = movementAdjustLevel.get();
        float cosDelta = MathHelper.cos((float) Math.toRadians(deltaYaw));
        float sinDelta = MathHelper.sin((float) Math.toRadians(deltaYaw));
        float adjustedForward = forward * cosDelta + sideways * sinDelta;
        float adjustedSideways = sideways * cosDelta - forward * sinDelta;
        mc.player.input.movementForward = forward + (adjustedForward - forward) * adjustFactor;
        mc.player.input.movementSideways = sideways + (adjustedSideways - sideways) * adjustFactor;
    }

    private void adjustMovementOnCollision(float spoofedYaw) {
        if (mc.player == null) {
            return;
        }
        float deltaYaw = MathHelper.wrapDegrees(spoofedYaw - mc.player.getYaw());
        float forward = mc.player.input.movementForward;
        float sideways = mc.player.input.movementSideways;
        float adjustFactor = movementAdjustLevel.get() * 0.5f;
        float cosDelta = MathHelper.cos((float) Math.toRadians(deltaYaw));
        float sinDelta = MathHelper.sin((float) Math.toRadians(deltaYaw));
        float adjustedForward = forward * cosDelta + sideways * sinDelta;
        float adjustedSideways = sideways * cosDelta - forward * sinDelta;
        mc.player.input.movementForward = forward + (adjustedForward - forward) * adjustFactor;
        mc.player.input.movementSideways = sideways + (adjustedSideways - sideways) * adjustFactor;

        mc.player.setVelocity(mc.player.getVelocity().multiply(0.8));
    }

    @Subscribe
    public void render3d(EventRender3D e) {
        if (mc.player == null || target == null) {
            return;
        }

        float baseFov = this.fov.get();
        double fov = calculateFOVFromCamera(target) * 3;
        TargetDraw.render(target);

        if (mc.player.distanceTo(target) >= range.get()) {
            TargetDraw.off();
        } else {
            TargetDraw.on();
        }
    }

    @Subscribe
    public void render2d(EventHud e) {
        if (mc.player == null || mc.getWindow() == null) {
            return;
        }
        int screenWidth = mc.getWindow().getScaledWidth();
        int screenHeight = mc.getWindow().getScaledHeight();
        float xWindow = screenWidth / 2.0f;
        float yWindow = screenHeight / 2.0f;
        if (renderFov.isState()) RenderHelper.drawCircle(e.getStack(), xWindow, yWindow, fov.get(), Color.WHITE);
    }

    private boolean autoCrit() {
        if (mc.player == null || mc.world == null) {
            return false;
        }

        switch (critMode.getSelected()) {
            case "Легит":
                if (attackSettings.isSelected("1.8 пвп")) {
                    if (attackSettings.isSelected("Только криты")) {
                        return !mc.player.isOnGround() && mc.player.fallDistance > 0.25f;
                    }
                    return true;
                }

                boolean reasonForSkipCrit = !attackSettings.isSelected("Только криты")
                        || mc.player.getAbilities().flying
                        || mc.player.hasStatusEffect(StatusEffects.LEVITATION)
                        || mc.player.hasStatusEffect(StatusEffects.BLINDNESS)
                        || PlayerHandler.isPlayerInWeb()
                        || mc.world.getBlockState(mc.player.getBlockPos()).getBlock() == Blocks.LADDER;

                if (PlayerHandler.getAttackStrengthScale(0.5f) < (mc.player.isOnGround() ? 1f : 0.9f))
                    return false;

                if (mc.player.isInLava())
                    return true;

                if (!mc.options.jumpKey.isPressed() && PlayerHandler.isAboveWater())
                    return true;

                if (!reasonForSkipCrit)
                    return !mc.player.isOnGround() && mc.player.fallDistance > 0.0f;
                return true;
            case "Всегда":
                return true;
            case "Воздух":
                return !mc.player.isOnGround();
            default:
                return false;
        }
    }

    private boolean shieldBreaker(boolean instant) {
        if (mc.player == null || mc.world == null) {
            return false;
        }

        int axeSlot = InventoryHelper.getAxe();
        if (axeSlot == -1) return false;
        if (!attackSettings.isSelected("Ломать щит")) return false;
        if (!(target instanceof PlayerEntity)) return false;
        if (!((PlayerEntity) target).isUsingItem() && !instant) return false;
        if (((PlayerEntity) target).getOffHandStack().getItem() != Items.SHIELD && ((PlayerEntity) target).getMainHandStack().getItem() != Items.SHIELD)
            return false;

        if (random.nextInt(5) == 0) {
            try {
                Thread.sleep(50 + random.nextInt(50));
            } catch (InterruptedException ex) {
                ex.printStackTrace();
            }
        }

        if (axeSlot >= 9) {
            mc.interactionManager.clickSlot(mc.player.currentScreenHandler.syncId, axeSlot, mc.player.getInventory().selectedSlot, SlotActionType.SWAP, mc.player);
            IMinecraft.sendPacket(new CloseHandledScreenC2SPacket(mc.player.currentScreenHandler.syncId));
            mc.interactionManager.attackEntity(mc.player, target);
            mc.player.swingHand(Hand.MAIN_HAND);
            mc.interactionManager.clickSlot(mc.player.currentScreenHandler.syncId, axeSlot, mc.player.getInventory().selectedSlot, SlotActionType.SWAP, mc.player);
            IMinecraft.sendPacket(new CloseHandledScreenC2SPacket(mc.player.currentScreenHandler.syncId));
        } else {
            IMinecraft.sendPacket(new UpdateSelectedSlotC2SPacket(axeSlot));
            mc.interactionManager.attackEntity(mc.player, target);
            mc.player.swingHand(Hand.MAIN_HAND);
            IMinecraft.sendPacket(new UpdateSelectedSlotC2SPacket(mc.player.getInventory().selectedSlot));
        }
        return true;
    }

    private LivingEntity find() {
        if (mc.player == null || mc.world == null) {
            return null;
        }

        List<LivingEntity> first_stage = new CopyOnWriteArrayList<>();
        for (Entity ent : mc.world.getEntities()) {
            if (ent == mc.player) continue;
            if (!(ent instanceof LivingEntity)) continue;
            if (!isValid((LivingEntity) ent)) continue;
            first_stage.add((LivingEntity) ent);
        }

        if (!first_stage.isEmpty() && random.nextInt(10) < 3) {
            return first_stage.get(random.nextInt(first_stage.size()));
        }

        return switch (sortMode.getSelected()) {
            case "Дистанция" ->
                    first_stage.stream().min(Comparator.comparing(e -> (mc.player.squaredDistanceTo(e.getPos())))).orElse(null);
            case "Здоровье" ->
                    first_stage.stream().min(Comparator.comparing(e -> (e.getHealth() + e.getAbsorptionAmount()))).orElse(null);
            case "Прочность брони" -> first_stage.stream().min(Comparator.comparing(e -> {
                float v = 0;
                for (ItemStack armor : e.getArmorItems())
                    if (armor != null && !armor.getItem().equals(Items.AIR)) {
                        v += ((armor.getMaxDamage() - armor.getDamage()) / (float) armor.getMaxDamage());
                    }
                return v;
            })).orElse(null);
            case "Наводка" -> first_stage.stream().min(Comparator.comparingDouble(AuraUtil::calculateFOVFromCamera))
                    .orElse(null);
            case "Адаптивный" ->
                    first_stage.stream().min(Comparator.comparing(e -> {
                        float health = e.getHealth() + e.getAbsorptionAmount();
                        double distance = mc.player.squaredDistanceTo(e.getPos());
                        float armor = 0;
                        for (ItemStack armorItem : e.getArmorItems())
                            if (armorItem != null && !armorItem.getItem().equals(Items.AIR)) {
                                armor += ((armorItem.getMaxDamage() - armorItem.getDamage()) / (float) armorItem.getMaxDamage());
                            }
                        return health * 0.4f + distance * 0.3f + armor * 0.3f;
                    })).orElse(null);
            default -> first_stage.stream().min(Comparator.comparing(e -> (mc.player.squaredDistanceTo(e.getPos())))).orElse(null);
        };
    }

    private boolean isValid(final LivingEntity entity) {
        if (mc.player == null || entity == null) return false;
        if (!attackSettings.isSelected("Бить через стены") && !mc.player.canSee(entity)) return false;
        if (entity.getHealth() <= 0 || !entity.isAlive() || entity.equals(mc.player)) return false;
        if (entity instanceof ArmorStandEntity) return false;
        if (!targets.isSelected("Невидимые") && entity.isInvisible() && ignoreInvisible.isState()) return false;
        if (entity.age < 10 && ignoreNewlySpawned.isState()) return false;
        if (entity instanceof PlayerEntity player) {
            if (FriendManager.checkFriend(player.getName().getString())) return false;
            if (!targets.isSelected("Игроки")) return false;
            if (!targets.isSelected("Голые") && player.getArmor() <= 0) return false;
            if (!targets.isSelected("Тиммейты") && mc.player.isTeammate(entity)) return false;
        }
        if (entity instanceof AnimalEntity) return targets.isSelected("Животные");
        if (entity instanceof MobEntity) return targets.isSelected("Мобы");
        return true;
    }

    @Override
    public void off() {
        TargetDraw.off();
        target = null;
        super.off();
    }

    @Override
    public void on() {
        if (mc.player != null) {
            currentRotationMode = getRotationMode();
        }
        TargetDraw.on();
        super.on();
    }
}

собственно вот код, если кому надо и если это поможет
 
хз нейронка вроде пофиксила:

Java:
Expand Collapse Copy
package ru.prodlasio.feature.implement.combat;

import com.google.common.eventbus.Subscribe;
import lombok.Getter;
import net.minecraft.block.Blocks;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.decoration.ArmorStandEntity;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.entity.mob.MobEntity;
import net.minecraft.entity.passive.AnimalEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket;
import net.minecraft.network.packet.c2s.play.CloseHandledScreenC2SPacket;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import net.minecraft.network.packet.c2s.play.UpdateSelectedSlotC2SPacket;
import net.minecraft.screen.slot.SlotActionType;
import net.minecraft.util.Hand;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import ru.prodlasio.events.impl.EventHud;
import ru.prodlasio.events.impl.EventPacketSend;
import ru.prodlasio.events.impl.EventPlayerTick;
import ru.prodlasio.events.impl.EventRender3D;
import ru.prodlasio.events.impl.EventUpdate;
import ru.prodlasio.feature.Category;
import ru.prodlasio.feature.Feature;
import ru.prodlasio.feature.FeatureInfo;
import ru.prodlasio.feature.implement.combat.utils.AuraUtil;
import ru.prodlasio.feature.settings.impl.*;
import ru.prodlasio.helper.IMinecraft;
import ru.prodlasio.helper.main.manager.friend.FriendManager;
import ru.prodlasio.helper.main.render.RenderHelper;
import ru.prodlasio.helper.main.render.TargetDraw;
import ru.prodlasio.helper.other.player.InventoryHelper;
import ru.prodlasio.helper.other.player.PlayerHandler;

import java.awt.*;
import java.util.Comparator;
import java.util.List;
import java.util.Random;
import java.util.concurrent.CopyOnWriteArrayList;

import static ru.prodlasio.feature.implement.combat.utils.AuraUtil.*;

@FeatureInfo(name = "KillAura", category = Category.COMBAT, desc = "Автоматически атакует сущности с продвинутыми обходами античитов")
public class Aura extends Feature {
    public Aura() {
        add(fov, attackSettings, nohitwnen, renderFov, sortMode, targets, maxCPS, minCPS, maxTurnSpeed, failRate,
                ignoreInvisible, ignoreNewlySpawned, range, silentAim, movementAdjustLevel, rotationMode, rotationType,
                useBypassPackets, critMode, visualRot, horizontalCollision);
    }

    public final SliderSetting fov = new SliderSetting("Угол обзора", 180F, 30F, 360F, 1F);
    public final ModeListSetting attackSettings = new ModeListSetting("Настройки атаки",
            "Ломать щит", "Только криты", "Бить через стены", "Сброс спринта", "1.8 пвп");
    public final ModeListSetting nohitwnen = new ModeListSetting("Не бить когда",
            "Ешь", "Открыто меню");
    private final ModeSetting sortMode = new ModeSetting("Режим сортировки",
            "Адаптивный", "Дистанция", "Здоровье", "Прочность брони", "Наводка");
    private static final ModeListSetting targets = new ModeListSetting("Таргеты",
            "Игроки", "Невидимые", "Голые", "Тиммейты", "Животные", "Мобы");
    public final BooleanSetting renderFov = new BooleanSetting("Рисовать FOV");
    public final SliderSetting maxCPS = new SliderSetting("Макс CPS", 20F, 1F, 30F, 1F);
    public final SliderSetting minCPS = new SliderSetting("Мин CPS", 10F, 1F, 20F, 1F);
    public final SliderSetting maxTurnSpeed = new SliderSetting("Макс скорость поворота", 90F, 10F, 180F, 1F);
    public final SliderSetting failRate = new SliderSetting("Шанс пропуска атаки", 5F, 0F, 20F, 1F);
    public final BooleanSetting ignoreInvisible = new BooleanSetting("Игнорировать невидимых", true);
    public final BooleanSetting ignoreNewlySpawned = new BooleanSetting("Игнорировать новых игроков", true);
    public final SliderSetting range = new SliderSetting("Дальность атаки", 4.2F, 3.0F, 6.0F, 0.1F);
    public final BooleanSetting silentAim = new BooleanSetting("Бесшумный прицел", true);
    public final SliderSetting movementAdjustLevel = new SliderSetting("Уровень корректировки движения", 0.5F, 0.0F, 1.0F, 0.1F);
    private final ModeSetting rotationMode = new ModeSetting("Режим ротации", "PerAttack", "Continuous");
    private final ModeSetting rotationType = new ModeSetting("Тип ротации", "Классический", "Продвинутый", "Spooky");
    public final BooleanSetting useBypassPackets = new BooleanSetting("Использовать обходные пакеты");
    private final ModeSetting critMode = new ModeSetting("Режим критов", "Легит", "Всегда", "Воздух");
    public final BooleanSetting visualRot = new BooleanSetting("От первого лица", false);
    public final BooleanSetting horizontalCollision = new BooleanSetting("Учитывать горизонтальную коллизию", true);

    [USER=270918]@Getter[/USER]
    LivingEntity target;

    private int attackTimer = 0;
    private final Random random = new Random();
    private RotationMode currentRotationMode;
    private float serverYaw, serverPitch;
    private boolean rotationsSet = false;

    public interface RotationMode {
        void update(LivingEntity target);
        float getYaw();
        float getPitch();
    }

    public class RotationAnimation {
        private float currentYaw;
        private float currentPitch;
        private float targetYaw;
        private float targetPitch;
        private int yawSpeed;
        private int pitchSpeed;

        public RotationAnimation() {
            currentYaw = 0.0f;
            currentPitch = 0.0f;
        }

        public void setTarget(float yaw, float pitch, int yawSpeed, int pitchSpeed) {
            this.targetYaw = yaw;
            this.targetPitch = pitch;
            this.yawSpeed = yawSpeed;
            this.pitchSpeed = pitchSpeed;
        }

        public void update() {
            if (mc.player == null) {
                return;
            }

            if (currentYaw == 0.0f && currentPitch == 0.0f) {
                currentYaw = mc.player.getYaw();
                currentPitch = mc.player.getPitch();
            }

            float deltaYaw = MathHelper.wrapDegrees(targetYaw - currentYaw);
            float deltaPitch = targetPitch - currentPitch;

            float yawStep = Math.signum(deltaYaw) * Math.min(Math.abs(deltaYaw), yawSpeed);
            float pitchStep = Math.signum(deltaPitch) * Math.min(Math.abs(deltaPitch), pitchSpeed);

            currentYaw += yawStep;
            currentPitch += pitchStep;

            if (Math.abs(deltaYaw) <= yawSpeed && Math.abs(deltaPitch) <= pitchSpeed) {
                currentYaw = targetYaw;
                currentPitch = targetPitch;
            }
        }

        public float getYaw() {
            return currentYaw;
        }

        public float getPitch() {
            return currentPitch;
        }
    }

    public class ClassicRotation implements RotationMode {
        private final RotationAnimation rotAnim = new RotationAnimation();

        [USER=1367676]@override[/USER]
        public void update(LivingEntity target) {
            if (mc.player == null) {
                return;
            }
            if (target == null) {
                rotAnim.setTarget(mc.player.getYaw(), mc.player.getPitch(), (int) (maxTurnSpeed.get() / 20F), (int) (maxTurnSpeed.get() / 20F));
                rotAnim.update();
                return;
            }
            float[] desired = getDesiredRotations(target);
            float targetYaw = desired[0];
            float targetPitch = desired[1];
            int yawSpeed = (int) (maxTurnSpeed.get() / 20F);
            int pitchSpeed = (int) (maxTurnSpeed.get() / 20F);
            rotAnim.setTarget(targetYaw, targetPitch, yawSpeed, pitchSpeed);
            rotAnim.update();
        }

        [USER=1367676]@override[/USER]
        public float getYaw() {
            return rotAnim.getYaw();
        }

        [USER=1367676]@override[/USER]
        public float getPitch() {
            return rotAnim.getPitch();
        }
    }

    public class AdvancedRotation implements RotationMode {
        private final RotationAnimation rotAnim = new RotationAnimation();

        [USER=1367676]@override[/USER]
        public void update(LivingEntity target) {
            if (mc.player == null) {
                return;
            }
            if (target == null) {
                rotAnim.setTarget(mc.player.getYaw(), mc.player.getPitch(), (int) (maxTurnSpeed.get() / 20F), (int) (maxTurnSpeed.get() / 20F));
                rotAnim.update();
                return;
            }
            Vec3d predictedPos = predictTargetPosition(target);
            float[] desired = getRotationsFromPos(predictedPos);
            float targetYaw = desired[0];
            float targetPitch = desired[1];
            int yawSpeed = (int) (maxTurnSpeed.get() / 20F);
            int pitchSpeed = (int) (maxTurnSpeed.get() / 20F);
            rotAnim.setTarget(targetYaw, targetPitch, yawSpeed, pitchSpeed);
            rotAnim.update();
        }

        [USER=1367676]@override[/USER]
        public float getYaw() {
            return rotAnim.getYaw();
        }

        [USER=1367676]@override[/USER]
        public float getPitch() {
            return rotAnim.getPitch();
        }

        private Vec3d predictTargetPosition(LivingEntity target) {
            Vec3d velocity = target.getVelocity();
            Vec3d pos = target.getBoundingBox().getCenter();
            return pos.add(velocity.multiply(0.5));
        }

        private float[] getRotationsFromPos(Vec3d pos) {
            if (mc.player == null) {
                return new float[]{0.0f, 0.0f};
            }
            Vec3d playerPos = mc.player.getEyePos();
            double deltaX = pos.x - playerPos.x;
            double deltaY = pos.y - playerPos.y;
            double deltaZ = pos.z - playerPos.z;
            double distanceXZ = Math.sqrt(deltaX * deltaX + deltaZ * deltaZ);
            float yaw = (float) Math.toDegrees(Math.atan2(deltaZ, deltaX)) - 90.0F;
            float pitch = (float) -Math.toDegrees(Math.atan2(deltaY, distanceXZ));
            return new float[]{yaw, pitch};
        }
    }

    public class SpookyRotation implements RotationMode {
        private final RotationAnimation rotAnim = new RotationAnimation();

        [USER=1367676]@override[/USER]
        public void update(LivingEntity target) {
            if (mc.player == null) {
                return;
            }
            if (target == null) {
                rotAnim.setTarget(mc.player.getYaw(), mc.player.getPitch(), (int) (maxTurnSpeed.get() / 20F), (int) (maxTurnSpeed.get() / 20F));
                rotAnim.update();
                return;
            }
            float[] desired = getDesiredRotations(target);
            float targetYaw = desired[0] + (random.nextFloat() - 0.5f) * 2.0f;
            float targetPitch = desired[1] + (random.nextFloat() - 0.5f) * 2.0f;
            int yawSpeed = (int) (maxTurnSpeed.get() / 15F);
            int pitchSpeed = (int) (maxTurnSpeed.get() / 15F);
            rotAnim.setTarget(targetYaw, targetPitch, yawSpeed, pitchSpeed);
            rotAnim.update();
        }

        [USER=1367676]@override[/USER]
        public float getYaw() {
            return rotAnim.getYaw();
        }

        [USER=1367676]@override[/USER]
        public float getPitch() {
            return rotAnim.getPitch();
        }
    }

    private float[] getDesiredRotations(LivingEntity entity) {
        if (mc.player == null) {
            return new float[]{0.0f, 0.0f};
        }
        Vec3d playerPos = mc.player.getEyePos();
        Vec3d targetPos = entity.getBoundingBox().getCenter();
        double deltaX = targetPos.x - playerPos.x;
        double deltaY = targetPos.y - playerPos.y;
        double deltaZ = targetPos.z - playerPos.z;
        double distanceXZ = Math.sqrt(deltaX * deltaX + deltaZ * deltaZ);
        float yaw = (float) Math.toDegrees(Math.atan2(deltaZ, deltaX)) - 90.0F;
        float pitch = (float) -Math.toDegrees(Math.atan2(deltaY, distanceXZ));
        float offset = 1.7f;
        yaw += (random.nextFloat() - 0.5f) * offset;
        pitch += (random.nextFloat() - 0.5f) * offset;
        return new float[]{yaw, pitch};
    }

    private RotationMode getRotationMode() {
        switch (rotationType.getSelected()) {
            case "Продвинутый":
                return new AdvancedRotation();
            case "Spooky":
                return new SpookyRotation();
            case "Классический":
            default:
                return new ClassicRotation();
        }
    }

    private boolean collideWith(Entity target) {
        if (mc.player == null || target == null || !horizontalCollision.isState()) {
            return false;
        }
        double distance = mc.player.getPos().distanceTo(target.getPos());
        return distance < 3;
    }

    [USER=1474073]@Subscribe[/USER]
    public void onPlayerTick(EventPlayerTick e) {
        if (mc.player == null || !rotationsSet) return;
        
        if (silentAim.isState() && visualRot.isState()) {
            mc.player.setYaw(serverYaw);
            mc.player.setPitch(serverPitch);
        }
    }

    [USER=1474073]@Subscribe[/USER]
    public void onPacketSend(EventPacketSend e) {
        if (mc.player == null || !rotationsSet || !silentAim.isState() || visualRot.isState()) return;
        
        if (e.getPacket() instanceof PlayerMoveC2SPacket packet) {
            if (packet.changesLook()) {
                e.setCancelled(true);
                
                PlayerMoveC2SPacket newPacket;
                if (packet.changesPosition()) {
                    newPacket = new PlayerMoveC2SPacket.Full(
                        packet.getX(), packet.getY(), packet.getZ(),
                        serverYaw, serverPitch,
                        packet.isOnGround());
                } else {
                    newPacket = new PlayerMoveC2SPacket.LookAndOnGround(
                        serverYaw, serverPitch, packet.isOnGround(), true);
                }
                mc.player.networkHandler.sendPacket(newPacket);
            }
        }
    }

    [USER=1474073]@Subscribe[/USER]
    public void onUpdate(EventUpdate e) {
        if (mc.player == null || mc.world == null) {
            return;
        }

        if (mc.player.isUsingItem() && nohitwnen.isSelected("Ешь")) {
            return;
        }
        if (mc.currentScreen != null && nohitwnen.isSelected("Открыто меню")) {
            return;
        }

        if (attackTimer > 0) {
            attackTimer--;
            return;
        }

        target = find();

        if (target == null) {
            rotationsSet = false;
            if (silentAim.isState() && rotationMode.getSelected().equals("Continuous")) {
                currentRotationMode.update(null);
                float yaw = mc.player.getYaw();
                float pitch = currentRotationMode.getPitch();
                mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.LookAndOnGround(yaw, pitch, mc.player.isOnGround(), true));
            }
            return;
        }

        TargetDraw.tick();

        if (!autoCrit()) return;

        if (shieldBreaker(false)) {
            setAttackTimer();
            return;
        }

        float baseFov = this.fov.get();
        double fov = calculateFOVFromCamera(target) * 3;

        if (silentAim.isState() && rotationMode.getSelected().equals("Continuous")) {
            currentRotationMode.update(target);
            serverYaw = currentRotationMode.getYaw();
            serverPitch = currentRotationMode.getPitch();
            
            mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.LookAndOnGround(
                serverYaw, serverPitch, mc.player.isOnGround(), true));
            rotationsSet = true;
            
            if (visualRot.isState()) {
                mc.player.setYaw(serverYaw);
                mc.player.setPitch(serverPitch);
            }
        }

        if (!FriendManager.checkFriend(target.getName().getString())
                && (silentAim.isState() || Math.abs(fov) < baseFov)
                && mc.player.distanceTo(target) <= range.get()
                && mc.player.getAttackCooldownProgress(0.5f) >= 1.0f) {
            if (random.nextInt(100) < failRate.get()) {
                return;
            }
            
            currentRotationMode.update(target);
            serverYaw = currentRotationMode.getYaw();
            serverPitch = currentRotationMode.getPitch();
            
            if (random.nextInt(10) < 4) {
                serverYaw += (random.nextFloat() - 0.5f) * 3f;
                serverPitch += (random.nextFloat() - 0.5f) * 3f;
            }
            
            attack(target);
            setAttackTimer();
            TargetDraw.on();
        }
    }

    private void setAttackTimer() {
        float cps = minCPS.get() + random.nextFloat() * (maxCPS.get() - minCPS.get());
        int attackInterval = (int) (1000 / cps / 50);
        attackTimer = attackInterval + random.nextInt(3);
    }

    public void attack(Entity entity) {
        if (mc.player == null || mc.world == null) {
            return;
        }

        boolean sprinting = mc.player.isSprinting();
        boolean needToResetSprint = attackSettings.isSelected("Сброс спринта");

        float originalYaw = mc.player.getYaw();
        float originalPitch = mc.player.getPitch();

        boolean isColliding = collideWith(entity);

        if (silentAim.isState()) {
            if (rotationMode.getSelected().equals("PerAttack")) {
                mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.LookAndOnGround(
                    serverYaw, serverPitch, mc.player.isOnGround(), true));
                rotationsSet = true;
            }

            if (!mc.player.isSwimming() && sprinting && needToResetSprint) {
                mc.player.networkHandler.sendPacket(new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.STOP_SPRINTING));
                mc.player.setSprinting(false);
            }

            mc.interactionManager.attackEntity(mc.player, entity);
            mc.player.swingHand(Hand.MAIN_HAND);

            if (!mc.player.isSwimming() && sprinting && needToResetSprint) {
                mc.player.setSprinting(true);
                mc.player.networkHandler.sendPacket(new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.START_SPRINTING));
            }

            if (rotationMode.getSelected().equals("PerAttack") && !visualRot.isState()) {
                mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.LookAndOnGround(
                    originalYaw, originalPitch, mc.player.isOnGround(), true));
                rotationsSet = false;
            }

            if (isColliding) {
                adjustMovementOnCollision(serverYaw);
            } else {
                adjustMovement(serverYaw);
            }
        } else {
            mc.player.setYaw(serverYaw);
            mc.player.setPitch(serverPitch);

            if (!mc.player.isSwimming() && sprinting && needToResetSprint) {
                mc.player.networkHandler.sendPacket(new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.STOP_SPRINTING));
                mc.player.setSprinting(false);
            }

            mc.interactionManager.attackEntity(mc.player, entity);
            mc.player.swingHand(Hand.MAIN_HAND);

            if (!mc.player.isSwimming() && sprinting && needToResetSprint) {
                mc.player.setSprinting(true);
                mc.player.networkHandler.sendPacket(new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.START_SPRINTING));
            }
        }
    }

    private void adjustMovement(float spoofedYaw) {
        if (mc.player == null) {
            return;
        }
        float deltaYaw = MathHelper.wrapDegrees(spoofedYaw - mc.player.getYaw());
        float forward = mc.player.input.movementForward;
        float sideways = mc.player.input.movementSideways;
        float adjustFactor = movementAdjustLevel.get();
        float cosDelta = MathHelper.cos((float) Math.toRadians(deltaYaw));
        float sinDelta = MathHelper.sin((float) Math.toRadians(deltaYaw));
        float adjustedForward = forward * cosDelta + sideways * sinDelta;
        float adjustedSideways = sideways * cosDelta - forward * sinDelta;
        mc.player.input.movementForward = forward + (adjustedForward - forward) * adjustFactor;
        mc.player.input.movementSideways = sideways + (adjustedSideways - sideways) * adjustFactor;
    }

    private void adjustMovementOnCollision(float spoofedYaw) {
        if (mc.player == null) {
            return;
        }
        float deltaYaw = MathHelper.wrapDegrees(spoofedYaw - mc.player.getYaw());
        float forward = mc.player.input.movementForward;
        float sideways = mc.player.input.movementSideways;
        float adjustFactor = movementAdjustLevel.get() * 0.5f;
        float cosDelta = MathHelper.cos((float) Math.toRadians(deltaYaw));
        float sinDelta = MathHelper.sin((float) Math.toRadians(deltaYaw));
        float adjustedForward = forward * cosDelta + sideways * sinDelta;
        float adjustedSideways = sideways * cosDelta - forward * sinDelta;
        mc.player.input.movementForward = forward + (adjustedForward - forward) * adjustFactor;
        mc.player.input.movementSideways = sideways + (adjustedSideways - sideways) * adjustFactor;

        mc.player.setVelocity(mc.player.getVelocity().multiply(0.8));
    }

    [USER=1474073]@Subscribe[/USER]
    public void render3d(EventRender3D e) {
        if (mc.player == null || target == null) {
            return;
        }

        float baseFov = this.fov.get();
        double fov = calculateFOVFromCamera(target) * 3;
        TargetDraw.render(target);

        if (mc.player.distanceTo(target) >= range.get()) {
            TargetDraw.off();
        } else {
            TargetDraw.on();
        }
    }

    [USER=1474073]@Subscribe[/USER]
    public void render2d(EventHud e) {
        if (mc.player == null || mc.getWindow() == null) {
            return;
        }
        int screenWidth = mc.getWindow().getScaledWidth();
        int screenHeight = mc.getWindow().getScaledHeight();
        float xWindow = screenWidth / 2.0f;
        float yWindow = screenHeight / 2.0f;
        if (renderFov.isState()) RenderHelper.drawCircle(e.getStack(), xWindow, yWindow, fov.get(), Color.WHITE);
    }

    private boolean autoCrit() {
        if (mc.player == null || mc.world == null) {
            return false;
        }

        switch (critMode.getSelected()) {
            case "Легит":
                if (attackSettings.isSelected("1.8 пвп")) {
                    if (attackSettings.isSelected("Только криты")) {
                        return !mc.player.isOnGround() && mc.player.fallDistance > 0.25f;
                    }
                    return true;
                }

                boolean reasonForSkipCrit = !attackSettings.isSelected("Только криты")
                        || mc.player.getAbilities().flying
                        || mc.player.hasStatusEffect(StatusEffects.LEVITATION)
                        || mc.player.hasStatusEffect(StatusEffects.BLINDNESS)
                        || PlayerHandler.isPlayerInWeb()
                        || mc.world.getBlockState(mc.player.getBlockPos()).getBlock() == Blocks.LADDER;

                if (PlayerHandler.getAttackStrengthScale(0.5f) < (mc.player.isOnGround() ? 1f : 0.9f))
                    return false;

                if (mc.player.isInLava())
                    return true;

                if (!mc.options.jumpKey.isPressed() && PlayerHandler.isAboveWater())
                    return true;

                if (!reasonForSkipCrit)
                    return !mc.player.isOnGround() && mc.player.fallDistance > 0.0f;
                return true;
            case "Всегда":
                return true;
            case "Воздух":
                return !mc.player.isOnGround();
            default:
                return false;
        }
    }

    private boolean shieldBreaker(boolean instant) {
        if (mc.player == null || mc.world == null) {
            return false;
        }

        int axeSlot = InventoryHelper.getAxe();
        if (axeSlot == -1) return false;
        if (!attackSettings.isSelected("Ломать щит")) return false;
        if (!(target instanceof PlayerEntity)) return false;
        if (!((PlayerEntity) target).isUsingItem() && !instant) return false;
        if (((PlayerEntity) target).getOffHandStack().getItem() != Items.SHIELD && ((PlayerEntity) target).getMainHandStack().getItem() != Items.SHIELD)
            return false;

        if (random.nextInt(5) == 0) {
            try {
                Thread.sleep(50 + random.nextInt(50));
            } catch (InterruptedException ex) {
                ex.printStackTrace();
            }
        }

        if (axeSlot >= 9) {
            mc.interactionManager.clickSlot(mc.player.currentScreenHandler.syncId, axeSlot, mc.player.getInventory().selectedSlot, SlotActionType.SWAP, mc.player);
            IMinecraft.sendPacket(new CloseHandledScreenC2SPacket(mc.player.currentScreenHandler.syncId));
            mc.interactionManager.attackEntity(mc.player, target);
            mc.player.swingHand(Hand.MAIN_HAND);
            mc.interactionManager.clickSlot(mc.player.currentScreenHandler.syncId, axeSlot, mc.player.getInventory().selectedSlot, SlotActionType.SWAP, mc.player);
            IMinecraft.sendPacket(new CloseHandledScreenC2SPacket(mc.player.currentScreenHandler.syncId));
        } else {
            IMinecraft.sendPacket(new UpdateSelectedSlotC2SPacket(axeSlot));
            mc.interactionManager.attackEntity(mc.player, target);
            mc.player.swingHand(Hand.MAIN_HAND);
            IMinecraft.sendPacket(new UpdateSelectedSlotC2SPacket(mc.player.getInventory().selectedSlot));
        }
        return true;
    }

    private LivingEntity find() {
        if (mc.player == null || mc.world == null) {
            return null;
        }

        List<LivingEntity> first_stage = new CopyOnWriteArrayList<>();
        for (Entity ent : mc.world.getEntities()) {
            if (ent == mc.player) continue;
            if (!(ent instanceof LivingEntity)) continue;
            if (!isValid((LivingEntity) ent)) continue;
            first_stage.add((LivingEntity) ent);
        }

        if (!first_stage.isEmpty() && random.nextInt(10) < 3) {
            return first_stage.get(random.nextInt(first_stage.size()));
        }

        return switch (sortMode.getSelected()) {
            case "Дистанция" ->
                    first_stage.stream().min(Comparator.comparing(e -> (mc.player.squaredDistanceTo(e.getPos())))).orElse(null);
            case "Здоровье" ->
                    first_stage.stream().min(Comparator.comparing(e -> (e.getHealth() + e.getAbsorptionAmount()))).orElse(null);
            case "Прочность брони" -> first_stage.stream().min(Comparator.comparing(e -> {
                float v = 0;
                for (ItemStack armor : e.getArmorItems())
                    if (armor != null && !armor.getItem().equals(Items.AIR)) {
                        v += ((armor.getMaxDamage() - armor.getDamage()) / (float) armor.getMaxDamage());
                    }
                return v;
            })).orElse(null);
            case "Наводка" -> first_stage.stream().min(Comparator.comparingDouble(AuraUtil::calculateFOVFromCamera))
                    .orElse(null);
            case "Адаптивный" ->
                    first_stage.stream().min(Comparator.comparing(e -> {
                        float health = e.getHealth() + e.getAbsorptionAmount();
                        double distance = mc.player.squaredDistanceTo(e.getPos());
                        float armor = 0;
                        for (ItemStack armorItem : e.getArmorItems())
                            if (armorItem != null && !armorItem.getItem().equals(Items.AIR)) {
                                armor += ((armorItem.getMaxDamage() - armorItem.getDamage()) / (float) armorItem.getMaxDamage());
                            }
                        return health * 0.4f + distance * 0.3f + armor * 0.3f;
                    })).orElse(null);
            default -> first_stage.stream().min(Comparator.comparing(e -> (mc.player.squaredDistanceTo(e.getPos())))).orElse(null);
        };
    }

    private boolean isValid(final LivingEntity entity) {
        if (mc.player == null || entity == null) return false;
        if (!attackSettings.isSelected("Бить через стены") && !mc.player.canSee(entity)) return false;
        if (entity.getHealth() <= 0 || !entity.isAlive() || entity.equals(mc.player)) return false;
        if (entity instanceof ArmorStandEntity) return false;
        if (!targets.isSelected("Невидимые") && entity.isInvisible() && ignoreInvisible.isState()) return false;
        if (entity.age < 10 && ignoreNewlySpawned.isState()) return false;
        if (entity instanceof PlayerEntity player) {
            if (FriendManager.checkFriend(player.getName().getString())) return false;
            if (!targets.isSelected("Игроки")) return false;
            if (!targets.isSelected("Голые") && player.getArmor() <= 0) return false;
            if (!targets.isSelected("Тиммейты") && mc.player.isTeammate(entity)) return false;
        }
        if (entity instanceof AnimalEntity) return targets.isSelected("Животные");
        if (entity instanceof MobEntity) return targets.isSelected("Мобы");
        return true;
    }

    [USER=1367676]@override[/USER]
    public void off() {
        TargetDraw.off();
        target = null;
        rotationsSet = false;
        super.off();
    }

    [USER=1367676]@override[/USER]
    public void on() {
        if (mc.player != null) {
            currentRotationMode = getRotationMode();
        }
        TargetDraw.on();
        super.on();
    }
}
 
хз нейронка вроде пофиксила:

Java:
Expand Collapse Copy
package ru.prodlasio.feature.implement.combat;

import com.google.common.eventbus.Subscribe;
import lombok.Getter;
import net.minecraft.block.Blocks;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.decoration.ArmorStandEntity;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.entity.mob.MobEntity;
import net.minecraft.entity.passive.AnimalEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket;
import net.minecraft.network.packet.c2s.play.CloseHandledScreenC2SPacket;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import net.minecraft.network.packet.c2s.play.UpdateSelectedSlotC2SPacket;
import net.minecraft.screen.slot.SlotActionType;
import net.minecraft.util.Hand;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import ru.prodlasio.events.impl.EventHud;
import ru.prodlasio.events.impl.EventPacketSend;
import ru.prodlasio.events.impl.EventPlayerTick;
import ru.prodlasio.events.impl.EventRender3D;
import ru.prodlasio.events.impl.EventUpdate;
import ru.prodlasio.feature.Category;
import ru.prodlasio.feature.Feature;
import ru.prodlasio.feature.FeatureInfo;
import ru.prodlasio.feature.implement.combat.utils.AuraUtil;
import ru.prodlasio.feature.settings.impl.*;
import ru.prodlasio.helper.IMinecraft;
import ru.prodlasio.helper.main.manager.friend.FriendManager;
import ru.prodlasio.helper.main.render.RenderHelper;
import ru.prodlasio.helper.main.render.TargetDraw;
import ru.prodlasio.helper.other.player.InventoryHelper;
import ru.prodlasio.helper.other.player.PlayerHandler;

import java.awt.*;
import java.util.Comparator;
import java.util.List;
import java.util.Random;
import java.util.concurrent.CopyOnWriteArrayList;

import static ru.prodlasio.feature.implement.combat.utils.AuraUtil.*;

@FeatureInfo(name = "KillAura", category = Category.COMBAT, desc = "Автоматически атакует сущности с продвинутыми обходами античитов")
public class Aura extends Feature {
    public Aura() {
        add(fov, attackSettings, nohitwnen, renderFov, sortMode, targets, maxCPS, minCPS, maxTurnSpeed, failRate,
                ignoreInvisible, ignoreNewlySpawned, range, silentAim, movementAdjustLevel, rotationMode, rotationType,
                useBypassPackets, critMode, visualRot, horizontalCollision);
    }

    public final SliderSetting fov = new SliderSetting("Угол обзора", 180F, 30F, 360F, 1F);
    public final ModeListSetting attackSettings = new ModeListSetting("Настройки атаки",
            "Ломать щит", "Только криты", "Бить через стены", "Сброс спринта", "1.8 пвп");
    public final ModeListSetting nohitwnen = new ModeListSetting("Не бить когда",
            "Ешь", "Открыто меню");
    private final ModeSetting sortMode = new ModeSetting("Режим сортировки",
            "Адаптивный", "Дистанция", "Здоровье", "Прочность брони", "Наводка");
    private static final ModeListSetting targets = new ModeListSetting("Таргеты",
            "Игроки", "Невидимые", "Голые", "Тиммейты", "Животные", "Мобы");
    public final BooleanSetting renderFov = new BooleanSetting("Рисовать FOV");
    public final SliderSetting maxCPS = new SliderSetting("Макс CPS", 20F, 1F, 30F, 1F);
    public final SliderSetting minCPS = new SliderSetting("Мин CPS", 10F, 1F, 20F, 1F);
    public final SliderSetting maxTurnSpeed = new SliderSetting("Макс скорость поворота", 90F, 10F, 180F, 1F);
    public final SliderSetting failRate = new SliderSetting("Шанс пропуска атаки", 5F, 0F, 20F, 1F);
    public final BooleanSetting ignoreInvisible = new BooleanSetting("Игнорировать невидимых", true);
    public final BooleanSetting ignoreNewlySpawned = new BooleanSetting("Игнорировать новых игроков", true);
    public final SliderSetting range = new SliderSetting("Дальность атаки", 4.2F, 3.0F, 6.0F, 0.1F);
    public final BooleanSetting silentAim = new BooleanSetting("Бесшумный прицел", true);
    public final SliderSetting movementAdjustLevel = new SliderSetting("Уровень корректировки движения", 0.5F, 0.0F, 1.0F, 0.1F);
    private final ModeSetting rotationMode = new ModeSetting("Режим ротации", "PerAttack", "Continuous");
    private final ModeSetting rotationType = new ModeSetting("Тип ротации", "Классический", "Продвинутый", "Spooky");
    public final BooleanSetting useBypassPackets = new BooleanSetting("Использовать обходные пакеты");
    private final ModeSetting critMode = new ModeSetting("Режим критов", "Легит", "Всегда", "Воздух");
    public final BooleanSetting visualRot = new BooleanSetting("От первого лица", false);
    public final BooleanSetting horizontalCollision = new BooleanSetting("Учитывать горизонтальную коллизию", true);

    [USER=270918]@Getter[/USER]
    LivingEntity target;

    private int attackTimer = 0;
    private final Random random = new Random();
    private RotationMode currentRotationMode;
    private float serverYaw, serverPitch;
    private boolean rotationsSet = false;

    public interface RotationMode {
        void update(LivingEntity target);
        float getYaw();
        float getPitch();
    }

    public class RotationAnimation {
        private float currentYaw;
        private float currentPitch;
        private float targetYaw;
        private float targetPitch;
        private int yawSpeed;
        private int pitchSpeed;

        public RotationAnimation() {
            currentYaw = 0.0f;
            currentPitch = 0.0f;
        }

        public void setTarget(float yaw, float pitch, int yawSpeed, int pitchSpeed) {
            this.targetYaw = yaw;
            this.targetPitch = pitch;
            this.yawSpeed = yawSpeed;
            this.pitchSpeed = pitchSpeed;
        }

        public void update() {
            if (mc.player == null) {
                return;
            }

            if (currentYaw == 0.0f && currentPitch == 0.0f) {
                currentYaw = mc.player.getYaw();
                currentPitch = mc.player.getPitch();
            }

            float deltaYaw = MathHelper.wrapDegrees(targetYaw - currentYaw);
            float deltaPitch = targetPitch - currentPitch;

            float yawStep = Math.signum(deltaYaw) * Math.min(Math.abs(deltaYaw), yawSpeed);
            float pitchStep = Math.signum(deltaPitch) * Math.min(Math.abs(deltaPitch), pitchSpeed);

            currentYaw += yawStep;
            currentPitch += pitchStep;

            if (Math.abs(deltaYaw) <= yawSpeed && Math.abs(deltaPitch) <= pitchSpeed) {
                currentYaw = targetYaw;
                currentPitch = targetPitch;
            }
        }

        public float getYaw() {
            return currentYaw;
        }

        public float getPitch() {
            return currentPitch;
        }
    }

    public class ClassicRotation implements RotationMode {
        private final RotationAnimation rotAnim = new RotationAnimation();

        [USER=1367676]@override[/USER]
        public void update(LivingEntity target) {
            if (mc.player == null) {
                return;
            }
            if (target == null) {
                rotAnim.setTarget(mc.player.getYaw(), mc.player.getPitch(), (int) (maxTurnSpeed.get() / 20F), (int) (maxTurnSpeed.get() / 20F));
                rotAnim.update();
                return;
            }
            float[] desired = getDesiredRotations(target);
            float targetYaw = desired[0];
            float targetPitch = desired[1];
            int yawSpeed = (int) (maxTurnSpeed.get() / 20F);
            int pitchSpeed = (int) (maxTurnSpeed.get() / 20F);
            rotAnim.setTarget(targetYaw, targetPitch, yawSpeed, pitchSpeed);
            rotAnim.update();
        }

        [USER=1367676]@override[/USER]
        public float getYaw() {
            return rotAnim.getYaw();
        }

        [USER=1367676]@override[/USER]
        public float getPitch() {
            return rotAnim.getPitch();
        }
    }

    public class AdvancedRotation implements RotationMode {
        private final RotationAnimation rotAnim = new RotationAnimation();

        [USER=1367676]@override[/USER]
        public void update(LivingEntity target) {
            if (mc.player == null) {
                return;
            }
            if (target == null) {
                rotAnim.setTarget(mc.player.getYaw(), mc.player.getPitch(), (int) (maxTurnSpeed.get() / 20F), (int) (maxTurnSpeed.get() / 20F));
                rotAnim.update();
                return;
            }
            Vec3d predictedPos = predictTargetPosition(target);
            float[] desired = getRotationsFromPos(predictedPos);
            float targetYaw = desired[0];
            float targetPitch = desired[1];
            int yawSpeed = (int) (maxTurnSpeed.get() / 20F);
            int pitchSpeed = (int) (maxTurnSpeed.get() / 20F);
            rotAnim.setTarget(targetYaw, targetPitch, yawSpeed, pitchSpeed);
            rotAnim.update();
        }

        [USER=1367676]@override[/USER]
        public float getYaw() {
            return rotAnim.getYaw();
        }

        [USER=1367676]@override[/USER]
        public float getPitch() {
            return rotAnim.getPitch();
        }

        private Vec3d predictTargetPosition(LivingEntity target) {
            Vec3d velocity = target.getVelocity();
            Vec3d pos = target.getBoundingBox().getCenter();
            return pos.add(velocity.multiply(0.5));
        }

        private float[] getRotationsFromPos(Vec3d pos) {
            if (mc.player == null) {
                return new float[]{0.0f, 0.0f};
            }
            Vec3d playerPos = mc.player.getEyePos();
            double deltaX = pos.x - playerPos.x;
            double deltaY = pos.y - playerPos.y;
            double deltaZ = pos.z - playerPos.z;
            double distanceXZ = Math.sqrt(deltaX * deltaX + deltaZ * deltaZ);
            float yaw = (float) Math.toDegrees(Math.atan2(deltaZ, deltaX)) - 90.0F;
            float pitch = (float) -Math.toDegrees(Math.atan2(deltaY, distanceXZ));
            return new float[]{yaw, pitch};
        }
    }

    public class SpookyRotation implements RotationMode {
        private final RotationAnimation rotAnim = new RotationAnimation();

        [USER=1367676]@override[/USER]
        public void update(LivingEntity target) {
            if (mc.player == null) {
                return;
            }
            if (target == null) {
                rotAnim.setTarget(mc.player.getYaw(), mc.player.getPitch(), (int) (maxTurnSpeed.get() / 20F), (int) (maxTurnSpeed.get() / 20F));
                rotAnim.update();
                return;
            }
            float[] desired = getDesiredRotations(target);
            float targetYaw = desired[0] + (random.nextFloat() - 0.5f) * 2.0f;
            float targetPitch = desired[1] + (random.nextFloat() - 0.5f) * 2.0f;
            int yawSpeed = (int) (maxTurnSpeed.get() / 15F);
            int pitchSpeed = (int) (maxTurnSpeed.get() / 15F);
            rotAnim.setTarget(targetYaw, targetPitch, yawSpeed, pitchSpeed);
            rotAnim.update();
        }

        [USER=1367676]@override[/USER]
        public float getYaw() {
            return rotAnim.getYaw();
        }

        [USER=1367676]@override[/USER]
        public float getPitch() {
            return rotAnim.getPitch();
        }
    }

    private float[] getDesiredRotations(LivingEntity entity) {
        if (mc.player == null) {
            return new float[]{0.0f, 0.0f};
        }
        Vec3d playerPos = mc.player.getEyePos();
        Vec3d targetPos = entity.getBoundingBox().getCenter();
        double deltaX = targetPos.x - playerPos.x;
        double deltaY = targetPos.y - playerPos.y;
        double deltaZ = targetPos.z - playerPos.z;
        double distanceXZ = Math.sqrt(deltaX * deltaX + deltaZ * deltaZ);
        float yaw = (float) Math.toDegrees(Math.atan2(deltaZ, deltaX)) - 90.0F;
        float pitch = (float) -Math.toDegrees(Math.atan2(deltaY, distanceXZ));
        float offset = 1.7f;
        yaw += (random.nextFloat() - 0.5f) * offset;
        pitch += (random.nextFloat() - 0.5f) * offset;
        return new float[]{yaw, pitch};
    }

    private RotationMode getRotationMode() {
        switch (rotationType.getSelected()) {
            case "Продвинутый":
                return new AdvancedRotation();
            case "Spooky":
                return new SpookyRotation();
            case "Классический":
            default:
                return new ClassicRotation();
        }
    }

    private boolean collideWith(Entity target) {
        if (mc.player == null || target == null || !horizontalCollision.isState()) {
            return false;
        }
        double distance = mc.player.getPos().distanceTo(target.getPos());
        return distance < 3;
    }

    [USER=1474073]@Subscribe[/USER]
    public void onPlayerTick(EventPlayerTick e) {
        if (mc.player == null || !rotationsSet) return;
       
        if (silentAim.isState() && visualRot.isState()) {
            mc.player.setYaw(serverYaw);
            mc.player.setPitch(serverPitch);
        }
    }

    [USER=1474073]@Subscribe[/USER]
    public void onPacketSend(EventPacketSend e) {
        if (mc.player == null || !rotationsSet || !silentAim.isState() || visualRot.isState()) return;
       
        if (e.getPacket() instanceof PlayerMoveC2SPacket packet) {
            if (packet.changesLook()) {
                e.setCancelled(true);
               
                PlayerMoveC2SPacket newPacket;
                if (packet.changesPosition()) {
                    newPacket = new PlayerMoveC2SPacket.Full(
                        packet.getX(), packet.getY(), packet.getZ(),
                        serverYaw, serverPitch,
                        packet.isOnGround());
                } else {
                    newPacket = new PlayerMoveC2SPacket.LookAndOnGround(
                        serverYaw, serverPitch, packet.isOnGround(), true);
                }
                mc.player.networkHandler.sendPacket(newPacket);
            }
        }
    }

    [USER=1474073]@Subscribe[/USER]
    public void onUpdate(EventUpdate e) {
        if (mc.player == null || mc.world == null) {
            return;
        }

        if (mc.player.isUsingItem() && nohitwnen.isSelected("Ешь")) {
            return;
        }
        if (mc.currentScreen != null && nohitwnen.isSelected("Открыто меню")) {
            return;
        }

        if (attackTimer > 0) {
            attackTimer--;
            return;
        }

        target = find();

        if (target == null) {
            rotationsSet = false;
            if (silentAim.isState() && rotationMode.getSelected().equals("Continuous")) {
                currentRotationMode.update(null);
                float yaw = mc.player.getYaw();
                float pitch = currentRotationMode.getPitch();
                mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.LookAndOnGround(yaw, pitch, mc.player.isOnGround(), true));
            }
            return;
        }

        TargetDraw.tick();

        if (!autoCrit()) return;

        if (shieldBreaker(false)) {
            setAttackTimer();
            return;
        }

        float baseFov = this.fov.get();
        double fov = calculateFOVFromCamera(target) * 3;

        if (silentAim.isState() && rotationMode.getSelected().equals("Continuous")) {
            currentRotationMode.update(target);
            serverYaw = currentRotationMode.getYaw();
            serverPitch = currentRotationMode.getPitch();
           
            mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.LookAndOnGround(
                serverYaw, serverPitch, mc.player.isOnGround(), true));
            rotationsSet = true;
           
            if (visualRot.isState()) {
                mc.player.setYaw(serverYaw);
                mc.player.setPitch(serverPitch);
            }
        }

        if (!FriendManager.checkFriend(target.getName().getString())
                && (silentAim.isState() || Math.abs(fov) < baseFov)
                && mc.player.distanceTo(target) <= range.get()
                && mc.player.getAttackCooldownProgress(0.5f) >= 1.0f) {
            if (random.nextInt(100) < failRate.get()) {
                return;
            }
           
            currentRotationMode.update(target);
            serverYaw = currentRotationMode.getYaw();
            serverPitch = currentRotationMode.getPitch();
           
            if (random.nextInt(10) < 4) {
                serverYaw += (random.nextFloat() - 0.5f) * 3f;
                serverPitch += (random.nextFloat() - 0.5f) * 3f;
            }
           
            attack(target);
            setAttackTimer();
            TargetDraw.on();
        }
    }

    private void setAttackTimer() {
        float cps = minCPS.get() + random.nextFloat() * (maxCPS.get() - minCPS.get());
        int attackInterval = (int) (1000 / cps / 50);
        attackTimer = attackInterval + random.nextInt(3);
    }

    public void attack(Entity entity) {
        if (mc.player == null || mc.world == null) {
            return;
        }

        boolean sprinting = mc.player.isSprinting();
        boolean needToResetSprint = attackSettings.isSelected("Сброс спринта");

        float originalYaw = mc.player.getYaw();
        float originalPitch = mc.player.getPitch();

        boolean isColliding = collideWith(entity);

        if (silentAim.isState()) {
            if (rotationMode.getSelected().equals("PerAttack")) {
                mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.LookAndOnGround(
                    serverYaw, serverPitch, mc.player.isOnGround(), true));
                rotationsSet = true;
            }

            if (!mc.player.isSwimming() && sprinting && needToResetSprint) {
                mc.player.networkHandler.sendPacket(new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.STOP_SPRINTING));
                mc.player.setSprinting(false);
            }

            mc.interactionManager.attackEntity(mc.player, entity);
            mc.player.swingHand(Hand.MAIN_HAND);

            if (!mc.player.isSwimming() && sprinting && needToResetSprint) {
                mc.player.setSprinting(true);
                mc.player.networkHandler.sendPacket(new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.START_SPRINTING));
            }

            if (rotationMode.getSelected().equals("PerAttack") && !visualRot.isState()) {
                mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.LookAndOnGround(
                    originalYaw, originalPitch, mc.player.isOnGround(), true));
                rotationsSet = false;
            }

            if (isColliding) {
                adjustMovementOnCollision(serverYaw);
            } else {
                adjustMovement(serverYaw);
            }
        } else {
            mc.player.setYaw(serverYaw);
            mc.player.setPitch(serverPitch);

            if (!mc.player.isSwimming() && sprinting && needToResetSprint) {
                mc.player.networkHandler.sendPacket(new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.STOP_SPRINTING));
                mc.player.setSprinting(false);
            }

            mc.interactionManager.attackEntity(mc.player, entity);
            mc.player.swingHand(Hand.MAIN_HAND);

            if (!mc.player.isSwimming() && sprinting && needToResetSprint) {
                mc.player.setSprinting(true);
                mc.player.networkHandler.sendPacket(new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.START_SPRINTING));
            }
        }
    }

    private void adjustMovement(float spoofedYaw) {
        if (mc.player == null) {
            return;
        }
        float deltaYaw = MathHelper.wrapDegrees(spoofedYaw - mc.player.getYaw());
        float forward = mc.player.input.movementForward;
        float sideways = mc.player.input.movementSideways;
        float adjustFactor = movementAdjustLevel.get();
        float cosDelta = MathHelper.cos((float) Math.toRadians(deltaYaw));
        float sinDelta = MathHelper.sin((float) Math.toRadians(deltaYaw));
        float adjustedForward = forward * cosDelta + sideways * sinDelta;
        float adjustedSideways = sideways * cosDelta - forward * sinDelta;
        mc.player.input.movementForward = forward + (adjustedForward - forward) * adjustFactor;
        mc.player.input.movementSideways = sideways + (adjustedSideways - sideways) * adjustFactor;
    }

    private void adjustMovementOnCollision(float spoofedYaw) {
        if (mc.player == null) {
            return;
        }
        float deltaYaw = MathHelper.wrapDegrees(spoofedYaw - mc.player.getYaw());
        float forward = mc.player.input.movementForward;
        float sideways = mc.player.input.movementSideways;
        float adjustFactor = movementAdjustLevel.get() * 0.5f;
        float cosDelta = MathHelper.cos((float) Math.toRadians(deltaYaw));
        float sinDelta = MathHelper.sin((float) Math.toRadians(deltaYaw));
        float adjustedForward = forward * cosDelta + sideways * sinDelta;
        float adjustedSideways = sideways * cosDelta - forward * sinDelta;
        mc.player.input.movementForward = forward + (adjustedForward - forward) * adjustFactor;
        mc.player.input.movementSideways = sideways + (adjustedSideways - sideways) * adjustFactor;

        mc.player.setVelocity(mc.player.getVelocity().multiply(0.8));
    }

    [USER=1474073]@Subscribe[/USER]
    public void render3d(EventRender3D e) {
        if (mc.player == null || target == null) {
            return;
        }

        float baseFov = this.fov.get();
        double fov = calculateFOVFromCamera(target) * 3;
        TargetDraw.render(target);

        if (mc.player.distanceTo(target) >= range.get()) {
            TargetDraw.off();
        } else {
            TargetDraw.on();
        }
    }

    [USER=1474073]@Subscribe[/USER]
    public void render2d(EventHud e) {
        if (mc.player == null || mc.getWindow() == null) {
            return;
        }
        int screenWidth = mc.getWindow().getScaledWidth();
        int screenHeight = mc.getWindow().getScaledHeight();
        float xWindow = screenWidth / 2.0f;
        float yWindow = screenHeight / 2.0f;
        if (renderFov.isState()) RenderHelper.drawCircle(e.getStack(), xWindow, yWindow, fov.get(), Color.WHITE);
    }

    private boolean autoCrit() {
        if (mc.player == null || mc.world == null) {
            return false;
        }

        switch (critMode.getSelected()) {
            case "Легит":
                if (attackSettings.isSelected("1.8 пвп")) {
                    if (attackSettings.isSelected("Только криты")) {
                        return !mc.player.isOnGround() && mc.player.fallDistance > 0.25f;
                    }
                    return true;
                }

                boolean reasonForSkipCrit = !attackSettings.isSelected("Только криты")
                        || mc.player.getAbilities().flying
                        || mc.player.hasStatusEffect(StatusEffects.LEVITATION)
                        || mc.player.hasStatusEffect(StatusEffects.BLINDNESS)
                        || PlayerHandler.isPlayerInWeb()
                        || mc.world.getBlockState(mc.player.getBlockPos()).getBlock() == Blocks.LADDER;

                if (PlayerHandler.getAttackStrengthScale(0.5f) < (mc.player.isOnGround() ? 1f : 0.9f))
                    return false;

                if (mc.player.isInLava())
                    return true;

                if (!mc.options.jumpKey.isPressed() && PlayerHandler.isAboveWater())
                    return true;

                if (!reasonForSkipCrit)
                    return !mc.player.isOnGround() && mc.player.fallDistance > 0.0f;
                return true;
            case "Всегда":
                return true;
            case "Воздух":
                return !mc.player.isOnGround();
            default:
                return false;
        }
    }

    private boolean shieldBreaker(boolean instant) {
        if (mc.player == null || mc.world == null) {
            return false;
        }

        int axeSlot = InventoryHelper.getAxe();
        if (axeSlot == -1) return false;
        if (!attackSettings.isSelected("Ломать щит")) return false;
        if (!(target instanceof PlayerEntity)) return false;
        if (!((PlayerEntity) target).isUsingItem() && !instant) return false;
        if (((PlayerEntity) target).getOffHandStack().getItem() != Items.SHIELD && ((PlayerEntity) target).getMainHandStack().getItem() != Items.SHIELD)
            return false;

        if (random.nextInt(5) == 0) {
            try {
                Thread.sleep(50 + random.nextInt(50));
            } catch (InterruptedException ex) {
                ex.printStackTrace();
            }
        }

        if (axeSlot >= 9) {
            mc.interactionManager.clickSlot(mc.player.currentScreenHandler.syncId, axeSlot, mc.player.getInventory().selectedSlot, SlotActionType.SWAP, mc.player);
            IMinecraft.sendPacket(new CloseHandledScreenC2SPacket(mc.player.currentScreenHandler.syncId));
            mc.interactionManager.attackEntity(mc.player, target);
            mc.player.swingHand(Hand.MAIN_HAND);
            mc.interactionManager.clickSlot(mc.player.currentScreenHandler.syncId, axeSlot, mc.player.getInventory().selectedSlot, SlotActionType.SWAP, mc.player);
            IMinecraft.sendPacket(new CloseHandledScreenC2SPacket(mc.player.currentScreenHandler.syncId));
        } else {
            IMinecraft.sendPacket(new UpdateSelectedSlotC2SPacket(axeSlot));
            mc.interactionManager.attackEntity(mc.player, target);
            mc.player.swingHand(Hand.MAIN_HAND);
            IMinecraft.sendPacket(new UpdateSelectedSlotC2SPacket(mc.player.getInventory().selectedSlot));
        }
        return true;
    }

    private LivingEntity find() {
        if (mc.player == null || mc.world == null) {
            return null;
        }

        List<LivingEntity> first_stage = new CopyOnWriteArrayList<>();
        for (Entity ent : mc.world.getEntities()) {
            if (ent == mc.player) continue;
            if (!(ent instanceof LivingEntity)) continue;
            if (!isValid((LivingEntity) ent)) continue;
            first_stage.add((LivingEntity) ent);
        }

        if (!first_stage.isEmpty() && random.nextInt(10) < 3) {
            return first_stage.get(random.nextInt(first_stage.size()));
        }

        return switch (sortMode.getSelected()) {
            case "Дистанция" ->
                    first_stage.stream().min(Comparator.comparing(e -> (mc.player.squaredDistanceTo(e.getPos())))).orElse(null);
            case "Здоровье" ->
                    first_stage.stream().min(Comparator.comparing(e -> (e.getHealth() + e.getAbsorptionAmount()))).orElse(null);
            case "Прочность брони" -> first_stage.stream().min(Comparator.comparing(e -> {
                float v = 0;
                for (ItemStack armor : e.getArmorItems())
                    if (armor != null && !armor.getItem().equals(Items.AIR)) {
                        v += ((armor.getMaxDamage() - armor.getDamage()) / (float) armor.getMaxDamage());
                    }
                return v;
            })).orElse(null);
            case "Наводка" -> first_stage.stream().min(Comparator.comparingDouble(AuraUtil::calculateFOVFromCamera))
                    .orElse(null);
            case "Адаптивный" ->
                    first_stage.stream().min(Comparator.comparing(e -> {
                        float health = e.getHealth() + e.getAbsorptionAmount();
                        double distance = mc.player.squaredDistanceTo(e.getPos());
                        float armor = 0;
                        for (ItemStack armorItem : e.getArmorItems())
                            if (armorItem != null && !armorItem.getItem().equals(Items.AIR)) {
                                armor += ((armorItem.getMaxDamage() - armorItem.getDamage()) / (float) armorItem.getMaxDamage());
                            }
                        return health * 0.4f + distance * 0.3f + armor * 0.3f;
                    })).orElse(null);
            default -> first_stage.stream().min(Comparator.comparing(e -> (mc.player.squaredDistanceTo(e.getPos())))).orElse(null);
        };
    }

    private boolean isValid(final LivingEntity entity) {
        if (mc.player == null || entity == null) return false;
        if (!attackSettings.isSelected("Бить через стены") && !mc.player.canSee(entity)) return false;
        if (entity.getHealth() <= 0 || !entity.isAlive() || entity.equals(mc.player)) return false;
        if (entity instanceof ArmorStandEntity) return false;
        if (!targets.isSelected("Невидимые") && entity.isInvisible() && ignoreInvisible.isState()) return false;
        if (entity.age < 10 && ignoreNewlySpawned.isState()) return false;
        if (entity instanceof PlayerEntity player) {
            if (FriendManager.checkFriend(player.getName().getString())) return false;
            if (!targets.isSelected("Игроки")) return false;
            if (!targets.isSelected("Голые") && player.getArmor() <= 0) return false;
            if (!targets.isSelected("Тиммейты") && mc.player.isTeammate(entity)) return false;
        }
        if (entity instanceof AnimalEntity) return targets.isSelected("Животные");
        if (entity instanceof MobEntity) return targets.isSelected("Мобы");
        return true;
    }

    [USER=1367676]@override[/USER]
    public void off() {
        TargetDraw.off();
        target = null;
        rotationsSet = false;
        super.off();
    }

    [USER=1367676]@override[/USER]
    public void on() {
        if (mc.player != null) {
            currentRotationMode = getRotationMode();
        }
        TargetDraw.on();
        super.on();
    }
}
не я помню писал килку и была такая же проблем закинул в абсолютно все нейронки которые знаю они сказали пофиксили а по итогу у меня были не снапы блять а голова от положения головы игрока к другому и обратно постоянно не в момент удара а до этого все норм было я поэтому хуй забил и пошел обф делать
 
Вы че тупые все это подменой пакетов делается
Ну сорян я просто впервые с нуля пишу. Ну ты тут самый умный так что ротация типо должна быть настоящей через изменения bodyYaw и head yaw или через пакеты? Мне просто надо что бы сказали как это работает я сделаю.
 
Ну сорян я просто впервые с нуля пишу. Ну ты тут самый умный так что ротация типо должна быть настоящей через изменения bodyYaw и head yaw или через пакеты? Мне просто надо что бы сказали как это работает я сделаю.
Я не про тебя если что написал сорян
 
Назад
Сверху Снизу