Подписывайтесь на наш Telegram и не пропускайте важные новости! Перейти

Вопрос Норм 1.21.4 киллаура?

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
16 Май 2026
Сообщения
9
Реакции
0
Всем дарова делаю свой клиент скажите нрм снап килауру для фт если нет то скажите пожалуйс та как сделаь ее лучше :


package com.beachclient.module.impl.combat;

import com.beachclient.BeachClient;
import com.beachclient.core.events.TickEvent;
import com.beachclient.module.Module;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.Box;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;

import java.util.*;
import java.util.stream.StreamSupport;

public class TideBreakerAura extends Module {

private static final float RANGE = 3.0f;
private static final long MIN_ATTACK_DELAY_MS = 450;

private boolean attackedThisJump = false;
private boolean wasOnGround = true;
private long lastGroundTime = 0;
private long lastJumpTime = 0;

// Smooth snap
private boolean isSnapping = false;
private int snapTicksRemaining = 0;
private int snapTotalTicks = 0;
private float snapStartYaw = 0f;
private float snapStartPitch = 0f;
private float snapTargetYaw = 0f;
private float snapTargetPitch = 0f;
private float currentSnapYaw = 0f;
private float currentSnapPitch = 0f;

private float aimOffsetY = 0f;
private int aimOffsetTimer = 0;

private long lastAttackMs = 0;
private int consecutiveAttacks = 0;
private long lastAttackResetTime = 0;

private LivingEntity target;
private final Random rng = new Random();

public TideBreakerAura() {
super("Tide-Breaker Aura", "Silent Snap KillAura", Category.COMBAT);
}

@override
public void onEnable() {
target = null;
attackedThisJump = false;
wasOnGround = true;
lastGroundTime = System.currentTimeMillis();
lastJumpTime = 0;
isSnapping = false;
snapTicksRemaining = 0;
consecutiveAttacks = 0;
lastAttackResetTime = System.currentTimeMillis();
BeachClient.INSTANCE.hasSilentRotation = false;
}

@override
public void onDisable() {
target = null;
BeachClient.INSTANCE.hasSilentRotation = false;
BeachClient.INSTANCE.pendingAttack = null;
}

@override
public void onTickEvent(TickEvent event) {
if (mc.player == null || mc.world == null || mc.player.isDead()) return;
if (mc.player.isUsingItem()) return;

float realYaw = mc.player.getYaw();
float realPitch = mc.player.getPitch();

boolean onGround = mc.player.isOnGround();
if (onGround) {
lastGroundTime = System.currentTimeMillis();
attackedThisJump = false;
} else if (wasOnGround && !onGround) {
lastJumpTime = System.currentTimeMillis();
}

if (!onGround && lastJumpTime > 0 && System.currentTimeMillis() - lastJumpTime > 2000) {
attackedThisJump = false;
}

wasOnGround = onGround;

target = findTarget();

// Update smooth snap animation
if (isSnapping && snapTicksRemaining > 0) {
float progress = 1.0f - (snapTicksRemaining / (float)snapTotalTicks);
// Smooth easing for gliding effect
progress = (float)(1.0 - Math.cos(progress * Math.PI)) / 2.0f;

currentSnapYaw = snapStartYaw + (snapTargetYaw - snapStartYaw) * progress;
currentSnapPitch = snapStartPitch + (snapTargetPitch - snapStartPitch) * progress;

mc.player.headYaw = currentSnapYaw;

snapTicksRemaining--;
if (snapTicksRemaining == 0) {
isSnapping = false;
}
}

// Attack logic
if (target != null && mc.player.distanceTo(target) <= RANGE && !attackedThisJump) {
float cooldown = mc.player.getAttackCooldownProgress(0f);
long timeSinceAttack = System.currentTimeMillis() - lastAttackMs;
long timeSinceGround = System.currentTimeMillis() - lastGroundTime;

boolean isFalling = !mc.player.isOnGround()
&& mc.player.getVelocity().y < 0
&& timeSinceGround > 50;

if (cooldown >= 0.88f && timeSinceAttack >= MIN_ATTACK_DELAY_MS && isFalling) {
Vec3d targetPos = calculateAimPoint(target);

// Simple velocity prediction
Vec3d targetVel = target.getVelocity();
double dist = mc.player.distanceTo(target);
double travelTime = dist / 25.0;
targetPos = targetPos.add(targetVel.multiply(travelTime * 0.6));

Vec3d eye = mc.player.getEyePos();
double dx = targetPos.x - eye.x;
double dy = targetPos.y - eye.y;
double dz = targetPos.z - eye.z;
double h = Math.sqrt(dx * dx + dz * dz);

float snapYaw = (float)Math.toDegrees(Math.atan2(dz, dx)) - 90f;
float snapPitch = MathHelper.clamp((float)-Math.toDegrees(Math.atan2(dy, h)), -90f, 90f);

// Calculate shortest path for yaw (wrap around 360)
float yawDiff = wrapDeg(snapYaw - headYaw);
float pitchDiff = snapPitch - headPitch;

// Use shortest path
float targetSnapYaw = headYaw + yawDiff;

// Calculate angle distance for snap duration
float angleDist = (float)Math.sqrt(yawDiff * yawDiff + pitchDiff * pitchDiff);

// Dynamic snap duration - smooth gliding
int snapDuration;
if (angleDist > 90) {
snapDuration = 10; // 500ms for large angles
} else if (angleDist > 60) {
snapDuration = 8; // 400ms for medium-large angles
} else if (angleDist > 30) {
snapDuration = 6; // 300ms for medium angles
} else {
snapDuration = 4; // 200ms for small angles
}

// Start smooth snap
isSnapping = true;
snapTicksRemaining = snapDuration;
snapTotalTicks = snapDuration;
snapStartYaw = headYaw;
snapStartPitch = headPitch;
snapTargetYaw = targetSnapYaw;
snapTargetPitch = snapPitch;
currentSnapYaw = headYaw;
currentSnapPitch = headPitch;

attackedThisJump = true;
lastAttackMs = System.currentTimeMillis();

BeachClient.INSTANCE.lockYaw = snapYaw;
BeachClient.INSTANCE.lockPitch = snapPitch;
BeachClient.INSTANCE.realYaw = realYaw;
BeachClient.INSTANCE.realPitch = realPitch;
BeachClient.INSTANCE.hasSilentRotation = true;
BeachClient.INSTANCE.pendingAttack = target;
} else {
BeachClient.INSTANCE.hasSilentRotation = false;
}
} else {
BeachClient.INSTANCE.hasSilentRotation = false;
}
}

private float wrapDeg(float a) {
while (a > 180f) a -= 360f;
while (a < -180f) a += 360f;
return a;
}

private Vec3d calculateAimPoint(LivingEntity target) {
double dist = mc.player.distanceTo(target);
Box b = target.getBoundingBox();
double eh = target.getHeight();

// Random hitbox point within center 70% for better accuracy
double xOffset = (rng.nextDouble() - 0.5) * (b.maxX - b.minX) * 0.5;
double zOffset = (rng.nextDouble() - 0.5) * (b.maxZ - b.minZ) * 0.5;

double baseRatio;
if (dist < 1.5) baseRatio = 0.25;
else if (dist < 2.5) baseRatio = 0.45;
else baseRatio = 0.65;

aimOffsetTimer--;
if (aimOffsetTimer <= 0) {
aimOffsetY = (float)(rng.nextGaussian() * 0.02);
aimOffsetTimer = 8 + rng.nextInt(12);
}

double aimY = b.minY + eh * baseRatio + aimOffsetY;
double aimX = (b.minX + b.maxX) * 0.5 + xOffset;
double aimZ = (b.minZ + b.maxZ) * 0.5 + zOffset;

return new Vec3d(aimX, aimY, aimZ);
}

private LivingEntity findTarget() {
return StreamSupport.stream(mc.world.getEntities().spliterator(), false)
.filter(e -> e instanceof LivingEntity && e != mc.player)
.map(e -> (LivingEntity) e)
.filter(LivingEntity::isAlive)
.filter(e -> e instanceof PlayerEntity)
.filter(e -> !(e instanceof PlayerEntity p && (p.isCreative() || p.isSpectator())))
.filter(e -> mc.player.distanceTo(e) <= RANGE)
.min(Comparator.comparingDouble(e -> mc.player.distanceTo(e)))
.orElse(null);
}

public LivingEntity getTarget() { return target; }
}
 
Назад
Сверху Снизу