Начинающий
Начинающий
- Статус
- Оффлайн
- Регистрация
- 2 Янв 2026
- Сообщения
- 17
- Реакции
- 0
Сделал килку под матрикс(учусь обходы делать) и ее флагает
Вот код:
package you.gay.module.impl.combat;
import com.google.common.eventbus.Subscribe;
import you.gay.api.event.impl.EventInput;
import you.gay.api.event.impl.EventMotion;
import you.gay.api.event.impl.EventTick;
import you.gay.module.Category;
import you.gay.module.Module;
import you.gay.module.setting.impl.BooleanSetting;
import you.gay.module.setting.impl.SliderSetting;
import you.gay.util.combat.AttackUtil;
import you.gay.util.combat.GCDUtil;
import you.gay.util.combat.StopWatch;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.block.Blocks;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.item.Items;
import net.minecraft.util.Hand;
import net.minecraft.util.math.Vec3d;
import org.joml.Vector2f;
import java.util.ArrayList;
import java.util.EnumSet;
import static you.gay.util.Wrapper.mc;
import static net.minecraft.util.math.MathHelper.*;
public class Aura extends Module {
SliderSetting radius = new SliderSetting("Радиус:", 3f, 1, 6, 0.1f);
BooleanSetting correction = new BooleanSetting("Коррекция:", true);
public Aura() {
super("Aura", Category.COMBAT);
addSettings(radius, correction);
}
public static LivingEntity target;
private Vector2f angle = new Vector2f(0, 0);
private StopWatch watch = new StopWatch();
int tick = 0;
@EventHandler
public void onMove(EventMotion e) {
e.setYaw(angle.x);
e.setPitch(angle.y);
e.cancel();
}
@EventHandler
public void onInput(EventInput e) {
if (target == null || mc.player == null || !correction.getValue()) return;
e.setYaw(angle.x, mc.player.getYaw());
}
@EventHandler
public void onHuy(EventTick e) {
if (nullCheck()) return;
target = getMinDistTarget();
if (target != null) {
if (canCritAttack() && watch.hasTimeElapsed()) {
mc.interactionManager.attackEntity(mc.player, target);
mc.player.swingHand(Hand.MAIN_HAND);
watch.setLastMS(500);
tick = 2;
}
if (tick > 0) {
updateRot();
tick--;
} else {
angle = new Vector2f(mc.player.getYaw(), mc.player.getPitch());
}
} else {
angle = new Vector2f(mc.player.getYaw(), mc.player.getPitch());
watch.setLastMS(0);
}
}
private void updateRot() {
float yawDelta = (wrapDegrees(getRotationsToEntity(mc.player, target)[0] - angle.x));
float pitchDelta = (wrapDegrees(getRotationsToEntity(mc.player, target)[1] - angle.y));
int roundedYaw = (int) yawDelta;
float yaw = angle.x + roundedYaw;
float pitch = clamp(angle.y + pitchDelta, -90, 90);
float gcd = (float) GCDUtil.getGcd();
yaw -= (yaw - angle.x) % gcd;
pitch -= (pitch - angle.y) % gcd;
angle = new Vector2f(yaw, pitch);
mc.player.setHeadYaw(angle.x);
mc.player.setBodyYaw(angle.x);
mc.player.renderPitch = angle.y;
}
private LivingEntity getMinDistTarget() {
ArrayList<LivingEntity> entities = new ArrayList<>();
for (Entity entity : mc.world.getEntities()) {
if (!(entity instanceof LivingEntity)) continue;
if (entity == mc.player) continue;
if (mc.player.distanceTo(entity) > radius.getValue()) continue;
entities.add((LivingEntity) entity);
}
LivingEntity minDistEntity = null;
float minDistance = Float.MAX_VALUE;
for (LivingEntity entity : entities) {
float distance = mc.player.distanceTo(entity);
if (distance < minDistance) {
minDistance = distance;
minDistEntity = entity;
}
}
return minDistEntity;
}
private boolean canCritAttack() {
if (mc.player.isUsingItem() && !mc.player.getActiveItem().isOf(Items.SHIELD)) return false;
boolean restrict = mc.player.hasStatusEffect(StatusEffects.BLINDNESS)
|| mc.player.hasStatusEffect(StatusEffects.LEVITATION)
|| mc.player.hasStatusEffect(StatusEffects.SLOW_FALLING)
|| mc.player.isInLava()
|| mc.player.inPowderSnow
|| mc.player.isClimbing()
|| mc.player.hasVehicle()
|| mc.player.getAbilities().flying
|| (mc.player.isInFluid() && !mc.options.jumpKey.isPressed())
|| AttackUtil.isPlayerInBlock(Blocks.COBWEB);
boolean needSpace = mc.player.isOnGround()
&& !mc.options.jumpKey.isPressed();
if (!restrict) {
return needSpace || (!mc.player.isOnGround() && mc.player.fallDistance > 0.0f);
}
return true;
}
public static float[] getRotationsToEntity(ClientPlayerEntity player, LivingEntity target) {
Vec3d eyes = new Vec3d(
player.getX(),
player.getY() + player.getEyeHeight(player.getPose()),
player.getZ()
);
Vec3d targetPos = new Vec3d(
target.getX(),
target.getY() + target.getEyeHeight(target.getPose()) - 0.1,
target.getZ()
);
double difX = targetPos.x - eyes.x;
double difY = targetPos.y - eyes.y;
double difZ = targetPos.z - eyes.z;
double dist = Math.sqrt(difX * difX + difZ * difZ);
float yaw = (float) Math.toDegrees(Math.atan2(difZ, difX)) - 90f;
float pitch = (float) -Math.toDegrees(Math.atan2(difY, dist));
// Нормализация yaw
while (yaw > 180f) yaw -= 360f;
while (yaw < -180f) yaw += 360f;
return new float[]{yaw += (float) GCDUtil.generateJitter(), pitch += (float) GCDUtil.generateJitter()};
}
@override
public void onDisable() {
super.onDisable();
target = null;
tick = 0;
}
}
Немного пасты, признаюсь
Вот код:
package you.gay.module.impl.combat;
import com.google.common.eventbus.Subscribe;
import you.gay.api.event.impl.EventInput;
import you.gay.api.event.impl.EventMotion;
import you.gay.api.event.impl.EventTick;
import you.gay.module.Category;
import you.gay.module.Module;
import you.gay.module.setting.impl.BooleanSetting;
import you.gay.module.setting.impl.SliderSetting;
import you.gay.util.combat.AttackUtil;
import you.gay.util.combat.GCDUtil;
import you.gay.util.combat.StopWatch;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.block.Blocks;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.item.Items;
import net.minecraft.util.Hand;
import net.minecraft.util.math.Vec3d;
import org.joml.Vector2f;
import java.util.ArrayList;
import java.util.EnumSet;
import static you.gay.util.Wrapper.mc;
import static net.minecraft.util.math.MathHelper.*;
public class Aura extends Module {
SliderSetting radius = new SliderSetting("Радиус:", 3f, 1, 6, 0.1f);
BooleanSetting correction = new BooleanSetting("Коррекция:", true);
public Aura() {
super("Aura", Category.COMBAT);
addSettings(radius, correction);
}
public static LivingEntity target;
private Vector2f angle = new Vector2f(0, 0);
private StopWatch watch = new StopWatch();
int tick = 0;
@EventHandler
public void onMove(EventMotion e) {
e.setYaw(angle.x);
e.setPitch(angle.y);
e.cancel();
}
@EventHandler
public void onInput(EventInput e) {
if (target == null || mc.player == null || !correction.getValue()) return;
e.setYaw(angle.x, mc.player.getYaw());
}
@EventHandler
public void onHuy(EventTick e) {
if (nullCheck()) return;
target = getMinDistTarget();
if (target != null) {
if (canCritAttack() && watch.hasTimeElapsed()) {
mc.interactionManager.attackEntity(mc.player, target);
mc.player.swingHand(Hand.MAIN_HAND);
watch.setLastMS(500);
tick = 2;
}
if (tick > 0) {
updateRot();
tick--;
} else {
angle = new Vector2f(mc.player.getYaw(), mc.player.getPitch());
}
} else {
angle = new Vector2f(mc.player.getYaw(), mc.player.getPitch());
watch.setLastMS(0);
}
}
private void updateRot() {
float yawDelta = (wrapDegrees(getRotationsToEntity(mc.player, target)[0] - angle.x));
float pitchDelta = (wrapDegrees(getRotationsToEntity(mc.player, target)[1] - angle.y));
int roundedYaw = (int) yawDelta;
float yaw = angle.x + roundedYaw;
float pitch = clamp(angle.y + pitchDelta, -90, 90);
float gcd = (float) GCDUtil.getGcd();
yaw -= (yaw - angle.x) % gcd;
pitch -= (pitch - angle.y) % gcd;
angle = new Vector2f(yaw, pitch);
mc.player.setHeadYaw(angle.x);
mc.player.setBodyYaw(angle.x);
mc.player.renderPitch = angle.y;
}
private LivingEntity getMinDistTarget() {
ArrayList<LivingEntity> entities = new ArrayList<>();
for (Entity entity : mc.world.getEntities()) {
if (!(entity instanceof LivingEntity)) continue;
if (entity == mc.player) continue;
if (mc.player.distanceTo(entity) > radius.getValue()) continue;
entities.add((LivingEntity) entity);
}
LivingEntity minDistEntity = null;
float minDistance = Float.MAX_VALUE;
for (LivingEntity entity : entities) {
float distance = mc.player.distanceTo(entity);
if (distance < minDistance) {
minDistance = distance;
minDistEntity = entity;
}
}
return minDistEntity;
}
private boolean canCritAttack() {
if (mc.player.isUsingItem() && !mc.player.getActiveItem().isOf(Items.SHIELD)) return false;
boolean restrict = mc.player.hasStatusEffect(StatusEffects.BLINDNESS)
|| mc.player.hasStatusEffect(StatusEffects.LEVITATION)
|| mc.player.hasStatusEffect(StatusEffects.SLOW_FALLING)
|| mc.player.isInLava()
|| mc.player.inPowderSnow
|| mc.player.isClimbing()
|| mc.player.hasVehicle()
|| mc.player.getAbilities().flying
|| (mc.player.isInFluid() && !mc.options.jumpKey.isPressed())
|| AttackUtil.isPlayerInBlock(Blocks.COBWEB);
boolean needSpace = mc.player.isOnGround()
&& !mc.options.jumpKey.isPressed();
if (!restrict) {
return needSpace || (!mc.player.isOnGround() && mc.player.fallDistance > 0.0f);
}
return true;
}
public static float[] getRotationsToEntity(ClientPlayerEntity player, LivingEntity target) {
Vec3d eyes = new Vec3d(
player.getX(),
player.getY() + player.getEyeHeight(player.getPose()),
player.getZ()
);
Vec3d targetPos = new Vec3d(
target.getX(),
target.getY() + target.getEyeHeight(target.getPose()) - 0.1,
target.getZ()
);
double difX = targetPos.x - eyes.x;
double difY = targetPos.y - eyes.y;
double difZ = targetPos.z - eyes.z;
double dist = Math.sqrt(difX * difX + difZ * difZ);
float yaw = (float) Math.toDegrees(Math.atan2(difZ, difX)) - 90f;
float pitch = (float) -Math.toDegrees(Math.atan2(difY, dist));
// Нормализация yaw
while (yaw > 180f) yaw -= 360f;
while (yaw < -180f) yaw += 360f;
return new float[]{yaw += (float) GCDUtil.generateJitter(), pitch += (float) GCDUtil.generateJitter()};
}
@override
public void onDisable() {
super.onDisable();
target = null;
tick = 0;
}
}
Немного пасты, признаюсь