Начинающий
- Статус
- Оффлайн
- Регистрация
- 7 Ноя 2025
- Сообщения
- 49
- Реакции
- 0
Пару раз бьет критом, потом 1 раз нет и потом опять критами и это повторяется постоянно.
Код:
package me.vyzov.modules.impl.combat;
import me.vyzov.api.events.impl.EventTick;
import me.vyzov.modules.api.Category;
import me.vyzov.modules.api.Module;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.scoreboard.ScoreHolder;
import net.minecraft.util.Hand;
import net.minecraft.util.math.Box;
public class Aura extends Module {
public Aura() {
super("Aura", Category.Combat, "Бьет игроков");
}
private boolean isAttacked = false;
private float originalYaw = 0;
private boolean shouldReset = false;
@EventHandler
public void onTick(EventTick e) {
if (mc.player == null || mc.world == null) return;
if (shouldReset) {
mc.player.setHeadYaw(originalYaw);
mc.player.setBodyYaw(originalYaw);
shouldReset = false;
}
LivingEntity target = getTarget(mc.player, 5);
if (target == null) return;
if (mc.options.jumpKey.wasPressed()) {
isAttacked = false;
}
if (!isAttacked && isCritAvivable()) {
originalYaw = mc.player.getYaw();
double angle = Math.atan2(target.getZ() - mc.player.getZ(), target.getX() - mc.player.getX()) * 180.0 / Math.PI - 90.0;
mc.player.setHeadYaw((float) angle);
mc.player.setBodyYaw((float) angle);
mc.interactionManager.attackEntity(mc.player, target);
shouldReset = true;
mc.player.swingHand(Hand.MAIN_HAND);
isAttacked = true;
}
if (mc.player.isOnGround()) {
isAttacked = false;
}
}
private LivingEntity getTarget(PlayerEntity player, float range) {
Box box = player.getBoundingBox().expand(range);
LivingEntity closest = null;
double bestDist = Double.MAX_VALUE;
for (Entity e : player.getWorld().getOtherEntities(player, box)) {
if (!(e instanceof LivingEntity le) || e == player || !le.isAlive()) continue;
if (e instanceof PlayerEntity p && p.isCreative()) continue;
double dist = player.squaredDistanceTo(e);
if (dist < bestDist) {
bestDist = dist;
closest = le;
}
}
return closest;
}
private boolean isCritAvivable() {
if (mc.player.isOnGround()) return false;
if (mc.player.getVelocity().y >= 0) return false;
double heightAboveGround = mc.player.getY() - Math.floor(mc.player.getY());
return heightAboveGround < 0.19f && mc.player.getAttackCooldownProgress(0.0f) >= 1.0f;
}
}
Это моя первая килка, не судите строго
Код:
package me.vyzov.modules.impl.combat;
import me.vyzov.api.events.impl.EventTick;
import me.vyzov.modules.api.Category;
import me.vyzov.modules.api.Module;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.scoreboard.ScoreHolder;
import net.minecraft.util.Hand;
import net.minecraft.util.math.Box;
public class Aura extends Module {
public Aura() {
super("Aura", Category.Combat, "Бьет игроков");
}
private boolean isAttacked = false;
private float originalYaw = 0;
private boolean shouldReset = false;
@EventHandler
public void onTick(EventTick e) {
if (mc.player == null || mc.world == null) return;
if (shouldReset) {
mc.player.setHeadYaw(originalYaw);
mc.player.setBodyYaw(originalYaw);
shouldReset = false;
}
LivingEntity target = getTarget(mc.player, 5);
if (target == null) return;
if (mc.options.jumpKey.wasPressed()) {
isAttacked = false;
}
if (!isAttacked && isCritAvivable()) {
originalYaw = mc.player.getYaw();
double angle = Math.atan2(target.getZ() - mc.player.getZ(), target.getX() - mc.player.getX()) * 180.0 / Math.PI - 90.0;
mc.player.setHeadYaw((float) angle);
mc.player.setBodyYaw((float) angle);
mc.interactionManager.attackEntity(mc.player, target);
shouldReset = true;
mc.player.swingHand(Hand.MAIN_HAND);
isAttacked = true;
}
if (mc.player.isOnGround()) {
isAttacked = false;
}
}
private LivingEntity getTarget(PlayerEntity player, float range) {
Box box = player.getBoundingBox().expand(range);
LivingEntity closest = null;
double bestDist = Double.MAX_VALUE;
for (Entity e : player.getWorld().getOtherEntities(player, box)) {
if (!(e instanceof LivingEntity le) || e == player || !le.isAlive()) continue;
if (e instanceof PlayerEntity p && p.isCreative()) continue;
double dist = player.squaredDistanceTo(e);
if (dist < bestDist) {
bestDist = dist;
closest = le;
}
}
return closest;
}
private boolean isCritAvivable() {
if (mc.player.isOnGround()) return false;
if (mc.player.getVelocity().y >= 0) return false;
double heightAboveGround = mc.player.getY() - Math.floor(mc.player.getY());
return heightAboveGround < 0.19f && mc.player.getAttackCooldownProgress(0.0f) >= 1.0f;
}
}
Это моя первая килка, не судите строго