Исходник SexAura Expensive 3.1 ready/mcp

Начинающий
Статус
Оффлайн
Регистрация
15 Мар 2024
Сообщения
212
Реакции[?]
1
Поинты[?]
1K

Перед прочтением основного контента ниже, пожалуйста, обратите внимание на обновление внутри секции Майна на нашем форуме. У нас появились:

  • бесплатные читы для Майнкрафт — любое использование на свой страх и риск;
  • маркетплейс Майнкрафт — абсолютно любая коммерция, связанная с игрой, за исключением продажи читов (аккаунты, предоставления услуг, поиск кодеров читов и так далее);
  • приватные читы для Minecraft — в этом разделе только платные хаки для игры, покупайте группу "Продавец" и выставляйте на продажу свой софт;
  • обсуждения и гайды — всё тот же раздел с вопросами, но теперь модернизированный: поиск нужных хаков, пати с игроками-читерами и другая полезная информация.

Спасибо!

Хз мб кому то надо
CTR SHIFT R:
package fuck.emelya.functions.impl.combat;


import com.google.common.eventbus.Subscribe;
import fuck.emelya.events.EventMotion;
import fuck.emelya.events.EventUpdate;
import fuck.emelya.functions.api.Category;

import fuck.emelya.functions.api.Function;
import fuck.emelya.functions.api.FunctionRegister;
import fuck.emelya.utils.RotationUtil;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.util.math.vector.Vector3d;


import java.util.ArrayList;
import java.util.List;

import static com.jhlabs.image.ImageMath.clamp;

@FunctionRegister(
        name = "SexAura",
        type = Category.Combat
)
public class SexAura extends Function {
    boolean isActionEnabled;

    @Subscribe
    public void onEvent(EventUpdate eventUpdate) {
        if (eventUpdate instanceof EventUpdate) {
            handleUpdate();
        } {
        }
    }

    private void handleEventMotion(EventMotion event) {
        LivingEntity target = getClosestEntity(25.0F);
        if (target != null) {
            float[] rots = RotationUtil.getMatrixRots(target);
            event.setYaw(rots[0]);
            event.setPitch(rots[1]);

            mc.player.rotationYaw = (rots[0]);
            mc.player.rotationYawHead = (rots[0]);
        }
    }

    public void handleUpdate() {
        LivingEntity target = getClosestEntity(25.0F);
        if (target != null) {
            boolean isCloseEnough = this.moveTowardsTargetIfNecessary(this.getTargetPositionOffset(target), clamp(target.getWidth() / 2.0F, 0.1F, 2.0F), target);
            this.performActionIfRequired(isCloseEnough);
        }
    }

    private Vector3d getTargetPositionOffset(LivingEntity target) {
        return target.getPositionVec().add(Math.sin(Math.toRadians(target.renderYawOffset)) * (double) (float) 0.3, 0.0, -Math.cos(Math.toRadians(target.renderYawOffset)) * (double) (float) 0.3);
    }

    private boolean moveTowardsTargetIfNecessary(Vector3d vec, float checkR, LivingEntity target) {
        boolean isCloseEnough = mc.player.getDistanceSq(vec) <= (double) checkR;

        if (!isCloseEnough) {
            KeyBinding.setKeyBindState(mc.gameSettings.keyBindForward.getDefault(), true);
        } else {
            KeyBinding.setKeyBindState(mc.gameSettings.keyBindForward.getDefault(), false);
        }

        return isCloseEnough;
    }

    private void performActionIfRequired(boolean DO) {
        if (DO) {
            mc.gameSettings.keyBindSneak.pressed = mc.player.ticksExisted % 2 == 0;
            if (!this.isActionEnabled) {
                this.isActionEnabled = true;
            }
        } else if (this.isActionEnabled) {
            mc.gameSettings.keyBindSneak.pressed = false;
            this.isActionEnabled = false;
        }
    }

    public LivingEntity getClosestEntity(double range) {
        List<LivingEntity> targets = new ArrayList<>();

        for (Entity entity : mc.world.getAllEntities()) {
            if (entity instanceof LivingEntity && entity != mc.player && mc.player.getDistance(entity) <= range) {
                targets.add((LivingEntity) entity);
            }
        }

        LivingEntity closestEntity = null;
        double closestDistance = Double.MAX_VALUE;

        for (LivingEntity target : targets) {
            double distance = mc.player.getDistance(target);
            if (distance < closestDistance) {
                closestEntity = target;
                closestDistance = distance;
            }
        }

        return closestEntity;
    }

    @Override
    public boolean onEnable() {
        this.performActionIfRequired(false);
        super.onEnable();
        return false;
    }
}
RotationUtil:
package im.expensive.utils;

import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;

import im.expensive.utils.client.IMinecraft;

import static im.expensive.utils.client.IMinecraft.mc;

public class RotationUtil {
    public static float[] getMatrixRots(Entity target) {
        double dX = target.getPosX() - mc.player.getPosX();
        double dZ = target.getPosZ() - mc.player.getPosZ();
        double dY = (target.getPosY() + target.getEyeHeight()) - (mc.player.getPosY() + mc.player.getEyeHeight());

        double dist = Math.sqrt(dX * dX + dZ * dZ);
        float yaw = (float) (Math.toDegrees(Math.atan2(dZ, dX)) - 90.0F);
        float pitch = (float) -Math.toDegrees(Math.atan2(dY, dist));

        return new float[]{yaw, pitch};
    }
}
Киньте попкорн пожалуйста
Забыл ss
 
Последнее редактирование:
Начинающий
Статус
Оффлайн
Регистрация
28 Май 2024
Сообщения
36
Реакции[?]
0
Поинты[?]
0
Хз мб кому то надо
CTR SHIFT R:
package fuck.emelya.functions.impl.combat;


import com.google.common.eventbus.Subscribe;
import fuck.emelya.events.EventMotion;
import fuck.emelya.events.EventUpdate;
import fuck.emelya.functions.api.Category;

import fuck.emelya.functions.api.Function;
import fuck.emelya.functions.api.FunctionRegister;
import fuck.emelya.utils.RotationUtil;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.util.math.vector.Vector3d;


import java.util.ArrayList;
import java.util.List;

import static com.jhlabs.image.ImageMath.clamp;

@FunctionRegister(
        name = "SexAura",
        type = Category.Combat
)
public class SexAura extends Function {
    boolean isActionEnabled;

    @Subscribe
    public void onEvent(EventUpdate eventUpdate) {
        if (eventUpdate instanceof EventUpdate) {
            handleUpdate();
        } {
        }
    }

    private void handleEventMotion(EventMotion event) {
        LivingEntity target = getClosestEntity(25.0F);
        if (target != null) {
            float[] rots = RotationUtil.getMatrixRots(target);
            event.setYaw(rots[0]);
            event.setPitch(rots[1]);

            mc.player.rotationYaw = (rots[0]);
            mc.player.rotationYawHead = (rots[0]);
        }
    }

    public void handleUpdate() {
        LivingEntity target = getClosestEntity(25.0F);
        if (target != null) {
            boolean isCloseEnough = this.moveTowardsTargetIfNecessary(this.getTargetPositionOffset(target), clamp(target.getWidth() / 2.0F, 0.1F, 2.0F), target);
            this.performActionIfRequired(isCloseEnough);
        }
    }

    private Vector3d getTargetPositionOffset(LivingEntity target) {
        return target.getPositionVec().add(Math.sin(Math.toRadians(target.renderYawOffset)) * (double) (float) 0.3, 0.0, -Math.cos(Math.toRadians(target.renderYawOffset)) * (double) (float) 0.3);
    }

    private boolean moveTowardsTargetIfNecessary(Vector3d vec, float checkR, LivingEntity target) {
        boolean isCloseEnough = mc.player.getDistanceSq(vec) <= (double) checkR;

        if (!isCloseEnough) {
            KeyBinding.setKeyBindState(mc.gameSettings.keyBindForward.getDefault(), true);
        } else {
            KeyBinding.setKeyBindState(mc.gameSettings.keyBindForward.getDefault(), false);
        }

        return isCloseEnough;
    }

    private void performActionIfRequired(boolean DO) {
        if (DO) {
            mc.gameSettings.keyBindSneak.pressed = mc.player.ticksExisted % 2 == 0;
            if (!this.isActionEnabled) {
                this.isActionEnabled = true;
            }
        } else if (this.isActionEnabled) {
            mc.gameSettings.keyBindSneak.pressed = false;
            this.isActionEnabled = false;
        }
    }

    public LivingEntity getClosestEntity(double range) {
        List<LivingEntity> targets = new ArrayList<>();

        for (Entity entity : mc.world.getAllEntities()) {
            if (entity instanceof LivingEntity && entity != mc.player && mc.player.getDistance(entity) <= range) {
                targets.add((LivingEntity) entity);
            }
        }

        LivingEntity closestEntity = null;
        double closestDistance = Double.MAX_VALUE;

        for (LivingEntity target : targets) {
            double distance = mc.player.getDistance(target);
            if (distance < closestDistance) {
                closestEntity = target;
                closestDistance = distance;
            }
        }

        return closestEntity;
    }

    @Override
    public boolean onEnable() {
        this.performActionIfRequired(false);
        super.onEnable();
        return false;
    }
}
RotationUtil:
package im.expensive.utils;

import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;

import im.expensive.utils.client.IMinecraft;

import static im.expensive.utils.client.IMinecraft.mc;

public class RotationUtil {
    public static float[] getMatrixRots(Entity target) {
        double dX = target.getPosX() - mc.player.getPosX();
        double dZ = target.getPosZ() - mc.player.getPosZ();
        double dY = (target.getPosY() + target.getEyeHeight()) - (mc.player.getPosY() + mc.player.getEyeHeight());

        double dist = Math.sqrt(dX * dX + dZ * dZ);
        float yaw = (float) (Math.toDegrees(Math.atan2(dZ, dX)) - 90.0F);
        float pitch = (float) -Math.toDegrees(Math.atan2(dY, dist));

        return new float[]{yaw, pitch};
    }
}
Киньте попкорн пожалуйста
Забыл ss
:kek:
 
Начинающий
Статус
Оффлайн
Регистрация
16 Июл 2023
Сообщения
103
Реакции[?]
5
Поинты[?]
5K
Ой кста а с какой темы взял 100% не с моей? Ну так как я тож её спиздил и доработал так что пох зато екс юзеры порадуются
 
Начинающий
Статус
Оффлайн
Регистрация
15 Мар 2024
Сообщения
212
Реакции[?]
1
Поинты[?]
1K
Ой кста а с какой темы взял 100% не с моей? Ну так как я тож её спиздил и доработал так что пох зато екс юзеры порадуются
нет не с твоей а с RIKERYT
Ой кста а с какой темы взял 100% не с моей? Ну так как я тож её спиздил и доработал так что пох зато екс юзеры порадуются
 
Начинающий
Статус
Оффлайн
Регистрация
15 Мар 2024
Сообщения
212
Реакции[?]
1
Поинты[?]
1K
спс бро дай сурсы фейк плейвер
FakePlayer:
package im.expensive.functions.impl.combat;

import com.google.common.eventbus.Subscribe;
import com.mojang.authlib.GameProfile;
import im.expensive.events.EventUpdate;
import im.expensive.functions.api.Category;
import im.expensive.functions.api.Function;
import im.expensive.functions.api.FunctionRegister;
import im.expensive.functions.settings.impl.ModeSetting;
import java.util.UUID;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.player.RemoteClientPlayerEntity;
import net.minecraft.entity.player.PlayerEntity;

@FunctionRegister(name="FakePlayer", type=Category.Combat)
public class FakePlayer
        extends Function {
    public ModeSetting mod = new ModeSetting("Действие:", "Спавн", "Спавн");
    Minecraft client = Minecraft.getInstance();
    private boolean Spawned = false;
    private RemoteClientPlayerEntity fakePlayer;

    public FakePlayer() {
        this.addSettings(this.mod);
    }

    @Subscribe
    private void onUpdate(EventUpdate var1) {
        if (this.mod.is("Спавн")) {
            this.spawnFakePlayer();
            this.Spawned = true;
        }
    }

    private void spawnFakePlayer() {
        UUID var1 = UUID.nameUUIDFromBytes("1337".getBytes());
        this.fakePlayer = new RemoteClientPlayerEntity(FakePlayer.mc.world, new GameProfile(var1, "Emelya"));
        this.fakePlayer.copyLocationAndAnglesFrom(mc.player);
        this.fakePlayer.rotationYawHead = mc.player.rotationYawHead;
        this.fakePlayer.renderYawOffset = mc.player.renderYawOffset;
        this.fakePlayer.rotationPitchHead = mc.player.rotationPitchHead;
        this.fakePlayer.container = mc.player.container;
        this.fakePlayer.inventory = mc.player.inventory;
        this.fakePlayer.setHealth(1337.0f);
        FakePlayer.mc.world.addEntity(1448, this.fakePlayer);
    }

    @Override
    public void onDisable() {
        this.removeFakePlayer();
        this.Spawned = false;
        super.onDisable();
    }

    protected float[] rotations(PlayerEntity player) {
        return new float[0];
    }

    private void removeFakePlayer() {
        FakePlayer.mc.world.removeEntityFromWorld(1337);
    }
}
 
Начинающий
Статус
Оффлайн
Регистрация
15 Мар 2024
Сообщения
212
Реакции[?]
1
Поинты[?]
1K
бро помоги это решить
На без ошибки:
package im.expensive.functions.impl.combat;


import com.google.common.eventbus.Subscribe;
import im.expensive.events.EventMotion;
import im.expensive.events.EventUpdate;
import im.expensive.functions.api.Category;

import im.expensive.functions.api.Function;
import im.expensive.functions.api.FunctionRegister;
import im.expensive.utils.RotationUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector3d;


import java.util.ArrayList;
import java.util.List;

import  im.expensive.utils.math.VectorUtils;

import static net.minecraft.util.math.MathHelper.clamp;


@FunctionRegister(
        name = "SexAura",
        type = Category.Combat
)
public class SexAura extends Function {
    boolean isActionEnabled;
    private final Minecraft mc = Minecraft.getInstance();
 
    @Subscribe
    public void onEvent(EventUpdate eventUpdate) {
        if (eventUpdate instanceof EventUpdate) {
            handleUpdate();
        } {
        }
    }

    private void handleEventMotion(EventMotion event) {
        LivingEntity target = getClosestEntity(25.0F);
        if (target != null) {
            float[] rots = RotationUtil.getMatrixRots(target);
            event.setYaw(rots[0]);
            event.setPitch(rots[1]);

            mc.player.rotationYaw = (rots[0]);
            mc.player.rotationYawHead = (rots[0]);
        }
    }

    public void handleUpdate() {
        LivingEntity target = getClosestEntity(25.0F);
        if (target != null) {
            boolean isCloseEnough = this.moveTowardsTargetIfNecessary(this.getTargetPositionOffset(target), clamp(target.getWidth() / 2.0F, 0.1F, 2.0F), target);
            this.performActionIfRequired(isCloseEnough);
        }
    }


   
   

    private Vector3d getTargetPositionOffset(LivingEntity target) {
        return target.getPositionVec().add(Math.sin(Math.toRadians(target.renderYawOffset)) * (double) (float) 0.3, 0.0, -Math.cos(Math.toRadians(target.renderYawOffset)) * (double) (float) 0.3);
    }

    private boolean moveTowardsTargetIfNecessary(Vector3d vec, float checkR, LivingEntity target) {
        boolean isCloseEnough = mc.player.getDistanceSq(vec) <= (double) checkR;

        if (!isCloseEnough) {
            KeyBinding.setKeyBindState(mc.gameSettings.keyBindForward.getDefault(), true);
        } else {
            KeyBinding.setKeyBindState(mc.gameSettings.keyBindForward.getDefault(), false);
        }

        return isCloseEnough;
    }

    private void performActionIfRequired(boolean DO) {
        if (DO) {
            mc.gameSettings.keyBindSneak.pressed = mc.player.ticksExisted % 2 == 0;
            if (!this.isActionEnabled) {
                this.isActionEnabled = true;
            }
        } else if (this.isActionEnabled) {
            mc.gameSettings.keyBindSneak.pressed = false;
            this.isActionEnabled = false;
        }
    }

    public LivingEntity getClosestEntity(double range) {
        List<LivingEntity> targets = new ArrayList<>();

        for (Entity entity : mc.world.getAllEntities()) {
            if (entity instanceof LivingEntity && entity != mc.player && mc.player.getDistance(entity) <= range) {
                targets.add((LivingEntity) entity);
            }
        }

        LivingEntity closestEntity = null;
        double closestDistance = Double.MAX_VALUE;

        for (LivingEntity target : targets) {
            double distance = mc.player.getDistance(target);
            if (distance < closestDistance) {
                closestEntity = target;
                closestDistance = distance;
            }
        }

        return closestEntity;
    }

    @Override
    public boolean onEnable() {
        this.performActionIfRequired(false);
        super.onEnable();
        return false;
    }

    }
На без ошибки:
package im.expensive.functions.impl.combat;


import com.google.common.eventbus.Subscribe;
import im.expensive.events.EventMotion;
import im.expensive.events.EventUpdate;
import im.expensive.functions.api.Category;

import im.expensive.functions.api.Function;
import im.expensive.functions.api.FunctionRegister;
import im.expensive.utils.RotationUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector3d;


import java.util.ArrayList;
import java.util.List;

import  im.expensive.utils.math.VectorUtils;

import static net.minecraft.util.math.MathHelper.clamp;


@FunctionRegister(
        name = "SexAura",
        type = Category.Combat
)
public class SexAura extends Function {
    boolean isActionEnabled;
    private final Minecraft mc = Minecraft.getInstance();

    @Subscribe
    public void onEvent(EventUpdate eventUpdate) {
        if (eventUpdate instanceof EventUpdate) {
            handleUpdate();
        } {
        }
    }

    private void handleEventMotion(EventMotion event) {
        LivingEntity target = getClosestEntity(25.0F);
        if (target != null) {
            float[] rots = RotationUtil.getMatrixRots(target);
            event.setYaw(rots[0]);
            event.setPitch(rots[1]);

            mc.player.rotationYaw = (rots[0]);
            mc.player.rotationYawHead = (rots[0]);
        }
    }

    public void handleUpdate() {
        LivingEntity target = getClosestEntity(25.0F);
        if (target != null) {
            boolean isCloseEnough = this.moveTowardsTargetIfNecessary(this.getTargetPositionOffset(target), clamp(target.getWidth() / 2.0F, 0.1F, 2.0F), target);
            this.performActionIfRequired(isCloseEnough);
        }
    }


  
  

    private Vector3d getTargetPositionOffset(LivingEntity target) {
        return target.getPositionVec().add(Math.sin(Math.toRadians(target.renderYawOffset)) * (double) (float) 0.3, 0.0, -Math.cos(Math.toRadians(target.renderYawOffset)) * (double) (float) 0.3);
    }

    private boolean moveTowardsTargetIfNecessary(Vector3d vec, float checkR, LivingEntity target) {
        boolean isCloseEnough = mc.player.getDistanceSq(vec) <= (double) checkR;

        if (!isCloseEnough) {
            KeyBinding.setKeyBindState(mc.gameSettings.keyBindForward.getDefault(), true);
        } else {
            KeyBinding.setKeyBindState(mc.gameSettings.keyBindForward.getDefault(), false);
        }

        return isCloseEnough;
    }

    private void performActionIfRequired(boolean DO) {
        if (DO) {
            mc.gameSettings.keyBindSneak.pressed = mc.player.ticksExisted % 2 == 0;
            if (!this.isActionEnabled) {
                this.isActionEnabled = true;
            }
        } else if (this.isActionEnabled) {
            mc.gameSettings.keyBindSneak.pressed = false;
            this.isActionEnabled = false;
        }
    }

    public LivingEntity getClosestEntity(double range) {
        List<LivingEntity> targets = new ArrayList<>();

        for (Entity entity : mc.world.getAllEntities()) {
            if (entity instanceof LivingEntity && entity != mc.player && mc.player.getDistance(entity) <= range) {
                targets.add((LivingEntity) entity);
            }
        }

        LivingEntity closestEntity = null;
        double closestDistance = Double.MAX_VALUE;

        for (LivingEntity target : targets) {
            double distance = mc.player.getDistance(target);
            if (distance < closestDistance) {
                closestEntity = target;
                closestDistance = distance;
            }
        }

        return closestEntity;
    }

    @Override
    public boolean onEnable() {
        this.performActionIfRequired(false);
        super.onEnable();
        return false;
    }

    }
Ротейшн утил:
package im.expensive.utils;

import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;

import im.expensive.utils.client.IMinecraft;








public class RotationUtil {




    public static float[] getMatrixRots(Entity target) {
        final Minecraft mc = Minecraft.getInstance();
        double dX = target.getPosX() - mc.player.getPosX();
        double dZ = target.getPosZ() - mc.player.getPosZ();
        double dY = (target.getPosY() + target.getEyeHeight()) - (mc.player.getPosY() + mc.player.getEyeHeight());

        double dist = Math.sqrt(dX * dX + dZ * dZ);
        float yaw = (float) (Math.toDegrees(Math.atan2(dZ, dX)) - 90.0F);
        float pitch = (float) -Math.toDegrees(Math.atan2(dY, dist));

        return new float[]{yaw, pitch};
    }
}
На без ошибки:
package im.expensive.functions.impl.combat;


import com.google.common.eventbus.Subscribe;
import im.expensive.events.EventMotion;
import im.expensive.events.EventUpdate;
import im.expensive.functions.api.Category;

import im.expensive.functions.api.Function;
import im.expensive.functions.api.FunctionRegister;
import im.expensive.utils.RotationUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector3d;


import java.util.ArrayList;
import java.util.List;

import  im.expensive.utils.math.VectorUtils;

import static net.minecraft.util.math.MathHelper.clamp;


@FunctionRegister(
        name = "SexAura",
        type = Category.Combat
)
public class SexAura extends Function {
    boolean isActionEnabled;
    private final Minecraft mc = Minecraft.getInstance();

    @Subscribe
    public void onEvent(EventUpdate eventUpdate) {
        if (eventUpdate instanceof EventUpdate) {
            handleUpdate();
        } {
        }
    }

    private void handleEventMotion(EventMotion event) {
        LivingEntity target = getClosestEntity(25.0F);
        if (target != null) {
            float[] rots = RotationUtil.getMatrixRots(target);
            event.setYaw(rots[0]);
            event.setPitch(rots[1]);

            mc.player.rotationYaw = (rots[0]);
            mc.player.rotationYawHead = (rots[0]);
        }
    }

    public void handleUpdate() {
        LivingEntity target = getClosestEntity(25.0F);
        if (target != null) {
            boolean isCloseEnough = this.moveTowardsTargetIfNecessary(this.getTargetPositionOffset(target), clamp(target.getWidth() / 2.0F, 0.1F, 2.0F), target);
            this.performActionIfRequired(isCloseEnough);
        }
    }


  
  

    private Vector3d getTargetPositionOffset(LivingEntity target) {
        return target.getPositionVec().add(Math.sin(Math.toRadians(target.renderYawOffset)) * (double) (float) 0.3, 0.0, -Math.cos(Math.toRadians(target.renderYawOffset)) * (double) (float) 0.3);
    }

    private boolean moveTowardsTargetIfNecessary(Vector3d vec, float checkR, LivingEntity target) {
        boolean isCloseEnough = mc.player.getDistanceSq(vec) <= (double) checkR;

        if (!isCloseEnough) {
            KeyBinding.setKeyBindState(mc.gameSettings.keyBindForward.getDefault(), true);
        } else {
            KeyBinding.setKeyBindState(mc.gameSettings.keyBindForward.getDefault(), false);
        }

        return isCloseEnough;
    }

    private void performActionIfRequired(boolean DO) {
        if (DO) {
            mc.gameSettings.keyBindSneak.pressed = mc.player.ticksExisted % 2 == 0;
            if (!this.isActionEnabled) {
                this.isActionEnabled = true;
            }
        } else if (this.isActionEnabled) {
            mc.gameSettings.keyBindSneak.pressed = false;
            this.isActionEnabled = false;
        }
    }

    public LivingEntity getClosestEntity(double range) {
        List<LivingEntity> targets = new ArrayList<>();

        for (Entity entity : mc.world.getAllEntities()) {
            if (entity instanceof LivingEntity && entity != mc.player && mc.player.getDistance(entity) <= range) {
                targets.add((LivingEntity) entity);
            }
        }

        LivingEntity closestEntity = null;
        double closestDistance = Double.MAX_VALUE;

        for (LivingEntity target : targets) {
            double distance = mc.player.getDistance(target);
            if (distance < closestDistance) {
                closestEntity = target;
                closestDistance = distance;
            }
        }

        return closestEntity;
    }

    @Override
    public boolean onEnable() {
        this.performActionIfRequired(false);
        super.onEnable();
        return false;
    }

    }
RotationUtil:
package im.expensive.utils;

import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;

import im.expensive.utils.client.IMinecraft;








public class RotationUtil {




    public static float[] getMatrixRots(Entity target) {
        final Minecraft mc = Minecraft.getInstance();
        double dX = target.getPosX() - mc.player.getPosX();
        double dZ = target.getPosZ() - mc.player.getPosZ();
        double dY = (target.getPosY() + target.getEyeHeight()) - (mc.player.getPosY() + mc.player.getEyeHeight());

        double dist = Math.sqrt(dX * dX + dZ * dZ);
        float yaw = (float) (Math.toDegrees(Math.atan2(dZ, dX)) - 90.0F);
        float pitch = (float) -Math.toDegrees(Math.atan2(dY, dist));

        return new float[]{yaw, pitch};
    }
}
 
Сверху Снизу