``
package Ravange.free.module.impl.combat;
import Ravange.free.event.EventTick;
import Ravange.free.event.EventUpdate;
import Ravange.free.module.Category;
import Ravange.free.module.Module;
import Ravange.free.util.Settings.BooleanSetting;
import Ravange.free.util.Settings.NumberSetting;
import Ravange.free.util.Settings.TSetting;
import com.google.common.eventbus.Subscribe;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.player.AbstractClientPlayerEntity;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.network.play.client.CEntityActionPacket;
import net.minecraft.network.play.client.CPlayerPacket;
import net.minecraft.network.play.client.CUseEntityPacket;
import net.minecraft.network.IPacket;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.Hand;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.RayTraceContext;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.vector.Vector3d;
import org.lwjgl.system.CallbackI;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class KillAura extends Module {
public static KillAura instance;
@TSetting
public BooleanSetting cel = new BooleanSetting("Фокусировать Цель", true);
@TSetting
public NumberSetting distation = new NumberSetting("Блоков до цели", 1, 7, 3);
@TSetting
public BooleanSetting krit = new BooleanSetting("Только крити", false);
@TSetting
public BooleanSetting players = new BooleanSetting("Атаковать игроков", true);
@TSetting
public BooleanSetting mobs = new BooleanSetting("Атаковать мобов", false);
@TSetting
public BooleanSetting plavnoya = new BooleanSetting("Плавная Килл Аура",false);
@TSetting
public BooleanSetting snap = new BooleanSetting("Снап",true);
private long lastAttackTime = 0;
private Entity targetEntity = null;
private float serverYaw = Float.NaN;
private float serverPitch = Float.NaN;
private float originalYaw = Float.NaN;
private float originalPitch = Float.NaN;
private float currentHeadYaw = Float.NaN;
private float currentHeadPitch = Float.NaN;
private float currentBodyYaw = Float.NaN;
public KillAura(String name, Category category) {
super(name, category);
instance = this;
}
public static boolean isRotationBlocked() {
return instance != null && instance.enable && instance.cel.value && instance.targetEntity != null;
}
public boolean attack = false;
public void checkTarget() {
Entity closest = null;
double closestDistance = distation.value;
for (Entity entity : mc.world.getAllEntities()) {
if (entity == mc.player || !entity.isAlive()) continue;
if (entity instanceof PlayerEntity && !players.value) continue;
if (!(entity instanceof PlayerEntity) && !mobs.value) continue;
double distance = mc.player.getDistance(entity);
if (distance <= closestDistance) {
closest = entity;
closestDistance = distance;
}
}
targetEntity = closest;
}
private float[] getRotationToEntity(Entity target) {
Vector3d eyes = mc.player.getEyePosition(1.0f);
Vector3d targetPos = target.getBoundingBox().getCenter();
double dx = targetPos.x - eyes.x;
double dy = targetPos.y - eyes.y;
double dz = targetPos.z - eyes.z;
double distXZ = Math.sqrt(dx * dx + dz * dz);
float yaw = (float) (Math.toDegrees(Math.atan2(dz, dx)) - 90.0);
float pitch = (float) -Math.toDegrees(Math.atan2(dy, distXZ));
yaw = MathHelper.wrapDegrees(yaw);
pitch = MathHelper.clamp(pitch, -90f, 90f);
return new float[]{yaw, pitch};
}
private float smoothAngle(float current, float target, float speed) {
float diff = MathHelper.wrapDegrees(target - current);
float change = MathHelper.clamp(diff, -speed, speed);
return current + change;
}
private float yawOffset = 0f;
private boolean yawIncreasing = true;
public void rotation() {
RayTraceResult ray = mc.world.rayTraceBlocks(new RayTraceContext(mc.player.getEyePosition(1f), targetEntity.getPositionVec().add(0, targetEntity.getHeight() * 0.5, 0), RayTraceContext.BlockMode.COLLIDER, RayTraceContext.FluidMode.NONE, mc.player));
if (ray.getType() == RayTraceResult.Type.BLOCK) {
return;
}
if (targetEntity == null || !targetEntity.isAlive()) {
resetRotation();
return;
}
float savedCameraYaw = mc.player.rotationYaw;
float savedCameraPitch = mc.player.rotationPitch;
float[] rotations = getRotationToEntity(targetEntity);
float targetYaw = rotations[0] ;
float targetPitch = rotations[1];
targetYaw = MathHelper.wrapDegrees(targetYaw);
targetPitch = MathHelper.clamp(targetPitch, -90f, 90f);
float yawSpeed = 0.5f;
float maxYawOffset = 6f;
if (yawIncreasing) {
yawOffset += yawSpeed;
if (yawOffset >= maxYawOffset) yawIncreasing = false;
} else {
yawOffset -= yawSpeed;
if (yawOffset <= -maxYawOffset) yawIncreasing = true;
}
serverYaw = targetYaw ;
serverPitch = targetPitch;
if (Float.isNaN(currentHeadYaw)) {
currentHeadYaw = mc.player.rotationYawHead;
}
if (Float.isNaN(currentHeadPitch)) {
currentHeadPitch = mc.player.rotationPitch;
}
if (Float.isNaN(currentBodyYaw)) {
currentBodyYaw = mc.player.renderYawOffset;
}
float diffToTarget = Math.abs(MathHelper.wrapDegrees(targetYaw - currentHeadYaw));
float maxChange = 6f;
float yawDiff = MathHelper.wrapDegrees(targetYaw - currentHeadYaw);
yawDiff = MathHelper.clamp(yawDiff, -maxChange, maxChange);
currentHeadYaw += yawDiff;
float headSpeed = (float) (180 / 10.0);
float headDiff = MathHelper.wrapDegrees(targetYaw - currentHeadYaw);
float headChange = MathHelper.clamp(headDiff, -headSpeed, headSpeed);
currentHeadYaw = MathHelper.wrapDegrees(currentHeadYaw + headChange);
float pitchSpeed = (float) (180 / 10.0);
float pitchDiff = targetPitch - currentHeadPitch;
float pitchChange = MathHelper.clamp(pitchDiff, -pitchSpeed, pitchSpeed);
currentHeadPitch = MathHelper.clamp(currentHeadPitch + pitchChange, -90f, 90f);
mc.player.rotationYawHead = currentHeadYaw + yawOffset;
mc.player.attackedAtYaw = currentHeadYaw;
mc.player.prevRotationYawHead = currentHeadYaw + yawOffset;
mc.player.rotationYaw = currentHeadYaw + yawOffset;
mc.player.rotationPitch = currentHeadPitch;
float bodyDiff = MathHelper.wrapDegrees(currentHeadYaw - currentBodyYaw);
float bodySpeed = (float) (180 / 12.0);
float bodyChange = MathHelper.clamp(bodyDiff, -bodySpeed, bodySpeed);
currentBodyYaw = MathHelper.wrapDegrees(currentBodyYaw + bodyChange);
mc.player.renderYawOffset = currentBodyYaw + yawOffset;
mc.player.prevRotationYaw = savedCameraYaw;
mc.player.prevRotationPitch = savedCameraPitch;
mc.player.prevRotationYawHead = currentHeadYaw;
mc.player.rotationYaw = savedCameraYaw;
mc.player.rotationPitch = savedCameraPitch;
}
private void resetRotation() {
serverYaw = Float.NaN;
serverPitch = Float.NaN;
currentHeadYaw = Float.NaN;
currentHeadPitch = Float.NaN;
currentBodyYaw = Float.NaN;
}
private void attackTarget() {
if (targetEntity == null || !targetEntity.isAlive()) return;
if (mc.playerController == null) return;
if (Float.isNaN(serverYaw) || Float.isNaN(serverPitch)) return;
Random r = new Random();
long currentTime = System.currentTimeMillis();
if (currentTime - lastAttackTime < new Random().nextLong(400,500)) return;
double distance = mc.player.getDistance(targetEntity);
if (distance > distation.value) return;
if (krit.value && mc.player.fallDistance <1) {
return;
}
originalYaw = mc.player.rotationYaw;
originalPitch = mc.player.rotationPitch;
float originalYawHead = mc.player.rotationYawHead;
float originalAttackedAtYaw = mc.player.attackedAtYaw;
mc.player.rotationYaw = serverYaw;
mc.player.rotationPitch = serverPitch;
mc.player.rotationYawHead = serverYaw;
mc.player.attackedAtYaw = serverYaw;
mc.player.prevRotationYaw = serverYaw;
mc.playerController.attackEntity(mc.player, targetEntity);
mc.player.swingArm(Hand.MAIN_HAND);
mc.player.rotationYaw = originalYaw;
mc.player.rotationPitch = originalPitch;
mc.player.rotationYawHead = originalYawHead;
mc.player.attackedAtYaw = originalAttackedAtYaw;
lastAttackTime = currentTime;
}
@override
public void onEnable() {
resetRotation();
super.onEnable();
}
@override
public void onDisable() {
resetRotation();
if (!Float.isNaN(originalYaw) && !Float.isNaN(originalPitch)) {
mc.player.rotationYaw = originalYaw;
mc.player.rotationPitch = originalPitch;
originalYaw = Float.NaN;
originalPitch = Float.NaN;
}
super.onDisable();
}
@Subscribe
public void onTick(EventUpdate e) {
if (mc.player == null || mc.world == null) return;
checkTarget();
if (targetEntity != null && targetEntity.isAlive()) {
originalYaw = mc.player.rotationYaw;
originalPitch = mc.player.rotationPitch;
if (cel.value) {rotation();}
mc.player.setSprinting(false);
attackTarget();
if (cel.value) {
mc.player.rotationYaw = originalYaw;
mc.player.rotationPitch = originalPitch;
}
} else {
resetRotation();
}
}
}
`` кароч ротация с свободной камерой но урон проходит есле игрок наводит камеру,как исправить? я кароч питался офнуть авто наводку камери в игре но ет не к чему не превело,вот и вишел на етот варянт,урона нету не регаер только есле игрок наведет камеру на хит бокс или рядом с хитом
package Ravange.free.module.impl.combat;
import Ravange.free.event.EventTick;
import Ravange.free.event.EventUpdate;
import Ravange.free.module.Category;
import Ravange.free.module.Module;
import Ravange.free.util.Settings.BooleanSetting;
import Ravange.free.util.Settings.NumberSetting;
import Ravange.free.util.Settings.TSetting;
import com.google.common.eventbus.Subscribe;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.player.AbstractClientPlayerEntity;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.network.play.client.CEntityActionPacket;
import net.minecraft.network.play.client.CPlayerPacket;
import net.minecraft.network.play.client.CUseEntityPacket;
import net.minecraft.network.IPacket;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.Hand;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.RayTraceContext;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.vector.Vector3d;
import org.lwjgl.system.CallbackI;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class KillAura extends Module {
public static KillAura instance;
@TSetting
public BooleanSetting cel = new BooleanSetting("Фокусировать Цель", true);
@TSetting
public NumberSetting distation = new NumberSetting("Блоков до цели", 1, 7, 3);
@TSetting
public BooleanSetting krit = new BooleanSetting("Только крити", false);
@TSetting
public BooleanSetting players = new BooleanSetting("Атаковать игроков", true);
@TSetting
public BooleanSetting mobs = new BooleanSetting("Атаковать мобов", false);
@TSetting
public BooleanSetting plavnoya = new BooleanSetting("Плавная Килл Аура",false);
@TSetting
public BooleanSetting snap = new BooleanSetting("Снап",true);
private long lastAttackTime = 0;
private Entity targetEntity = null;
private float serverYaw = Float.NaN;
private float serverPitch = Float.NaN;
private float originalYaw = Float.NaN;
private float originalPitch = Float.NaN;
private float currentHeadYaw = Float.NaN;
private float currentHeadPitch = Float.NaN;
private float currentBodyYaw = Float.NaN;
public KillAura(String name, Category category) {
super(name, category);
instance = this;
}
public static boolean isRotationBlocked() {
return instance != null && instance.enable && instance.cel.value && instance.targetEntity != null;
}
public boolean attack = false;
public void checkTarget() {
Entity closest = null;
double closestDistance = distation.value;
for (Entity entity : mc.world.getAllEntities()) {
if (entity == mc.player || !entity.isAlive()) continue;
if (entity instanceof PlayerEntity && !players.value) continue;
if (!(entity instanceof PlayerEntity) && !mobs.value) continue;
double distance = mc.player.getDistance(entity);
if (distance <= closestDistance) {
closest = entity;
closestDistance = distance;
}
}
targetEntity = closest;
}
private float[] getRotationToEntity(Entity target) {
Vector3d eyes = mc.player.getEyePosition(1.0f);
Vector3d targetPos = target.getBoundingBox().getCenter();
double dx = targetPos.x - eyes.x;
double dy = targetPos.y - eyes.y;
double dz = targetPos.z - eyes.z;
double distXZ = Math.sqrt(dx * dx + dz * dz);
float yaw = (float) (Math.toDegrees(Math.atan2(dz, dx)) - 90.0);
float pitch = (float) -Math.toDegrees(Math.atan2(dy, distXZ));
yaw = MathHelper.wrapDegrees(yaw);
pitch = MathHelper.clamp(pitch, -90f, 90f);
return new float[]{yaw, pitch};
}
private float smoothAngle(float current, float target, float speed) {
float diff = MathHelper.wrapDegrees(target - current);
float change = MathHelper.clamp(diff, -speed, speed);
return current + change;
}
private float yawOffset = 0f;
private boolean yawIncreasing = true;
public void rotation() {
RayTraceResult ray = mc.world.rayTraceBlocks(new RayTraceContext(mc.player.getEyePosition(1f), targetEntity.getPositionVec().add(0, targetEntity.getHeight() * 0.5, 0), RayTraceContext.BlockMode.COLLIDER, RayTraceContext.FluidMode.NONE, mc.player));
if (ray.getType() == RayTraceResult.Type.BLOCK) {
return;
}
if (targetEntity == null || !targetEntity.isAlive()) {
resetRotation();
return;
}
float savedCameraYaw = mc.player.rotationYaw;
float savedCameraPitch = mc.player.rotationPitch;
float[] rotations = getRotationToEntity(targetEntity);
float targetYaw = rotations[0] ;
float targetPitch = rotations[1];
targetYaw = MathHelper.wrapDegrees(targetYaw);
targetPitch = MathHelper.clamp(targetPitch, -90f, 90f);
float yawSpeed = 0.5f;
float maxYawOffset = 6f;
if (yawIncreasing) {
yawOffset += yawSpeed;
if (yawOffset >= maxYawOffset) yawIncreasing = false;
} else {
yawOffset -= yawSpeed;
if (yawOffset <= -maxYawOffset) yawIncreasing = true;
}
serverYaw = targetYaw ;
serverPitch = targetPitch;
if (Float.isNaN(currentHeadYaw)) {
currentHeadYaw = mc.player.rotationYawHead;
}
if (Float.isNaN(currentHeadPitch)) {
currentHeadPitch = mc.player.rotationPitch;
}
if (Float.isNaN(currentBodyYaw)) {
currentBodyYaw = mc.player.renderYawOffset;
}
float diffToTarget = Math.abs(MathHelper.wrapDegrees(targetYaw - currentHeadYaw));
float maxChange = 6f;
float yawDiff = MathHelper.wrapDegrees(targetYaw - currentHeadYaw);
yawDiff = MathHelper.clamp(yawDiff, -maxChange, maxChange);
currentHeadYaw += yawDiff;
float headSpeed = (float) (180 / 10.0);
float headDiff = MathHelper.wrapDegrees(targetYaw - currentHeadYaw);
float headChange = MathHelper.clamp(headDiff, -headSpeed, headSpeed);
currentHeadYaw = MathHelper.wrapDegrees(currentHeadYaw + headChange);
float pitchSpeed = (float) (180 / 10.0);
float pitchDiff = targetPitch - currentHeadPitch;
float pitchChange = MathHelper.clamp(pitchDiff, -pitchSpeed, pitchSpeed);
currentHeadPitch = MathHelper.clamp(currentHeadPitch + pitchChange, -90f, 90f);
mc.player.rotationYawHead = currentHeadYaw + yawOffset;
mc.player.attackedAtYaw = currentHeadYaw;
mc.player.prevRotationYawHead = currentHeadYaw + yawOffset;
mc.player.rotationYaw = currentHeadYaw + yawOffset;
mc.player.rotationPitch = currentHeadPitch;
float bodyDiff = MathHelper.wrapDegrees(currentHeadYaw - currentBodyYaw);
float bodySpeed = (float) (180 / 12.0);
float bodyChange = MathHelper.clamp(bodyDiff, -bodySpeed, bodySpeed);
currentBodyYaw = MathHelper.wrapDegrees(currentBodyYaw + bodyChange);
mc.player.renderYawOffset = currentBodyYaw + yawOffset;
mc.player.prevRotationYaw = savedCameraYaw;
mc.player.prevRotationPitch = savedCameraPitch;
mc.player.prevRotationYawHead = currentHeadYaw;
mc.player.rotationYaw = savedCameraYaw;
mc.player.rotationPitch = savedCameraPitch;
}
private void resetRotation() {
serverYaw = Float.NaN;
serverPitch = Float.NaN;
currentHeadYaw = Float.NaN;
currentHeadPitch = Float.NaN;
currentBodyYaw = Float.NaN;
}
private void attackTarget() {
if (targetEntity == null || !targetEntity.isAlive()) return;
if (mc.playerController == null) return;
if (Float.isNaN(serverYaw) || Float.isNaN(serverPitch)) return;
Random r = new Random();
long currentTime = System.currentTimeMillis();
if (currentTime - lastAttackTime < new Random().nextLong(400,500)) return;
double distance = mc.player.getDistance(targetEntity);
if (distance > distation.value) return;
if (krit.value && mc.player.fallDistance <1) {
return;
}
originalYaw = mc.player.rotationYaw;
originalPitch = mc.player.rotationPitch;
float originalYawHead = mc.player.rotationYawHead;
float originalAttackedAtYaw = mc.player.attackedAtYaw;
mc.player.rotationYaw = serverYaw;
mc.player.rotationPitch = serverPitch;
mc.player.rotationYawHead = serverYaw;
mc.player.attackedAtYaw = serverYaw;
mc.player.prevRotationYaw = serverYaw;
mc.playerController.attackEntity(mc.player, targetEntity);
mc.player.swingArm(Hand.MAIN_HAND);
mc.player.rotationYaw = originalYaw;
mc.player.rotationPitch = originalPitch;
mc.player.rotationYawHead = originalYawHead;
mc.player.attackedAtYaw = originalAttackedAtYaw;
lastAttackTime = currentTime;
}
@override
public void onEnable() {
resetRotation();
super.onEnable();
}
@override
public void onDisable() {
resetRotation();
if (!Float.isNaN(originalYaw) && !Float.isNaN(originalPitch)) {
mc.player.rotationYaw = originalYaw;
mc.player.rotationPitch = originalPitch;
originalYaw = Float.NaN;
originalPitch = Float.NaN;
}
super.onDisable();
}
@Subscribe
public void onTick(EventUpdate e) {
if (mc.player == null || mc.world == null) return;
checkTarget();
if (targetEntity != null && targetEntity.isAlive()) {
originalYaw = mc.player.rotationYaw;
originalPitch = mc.player.rotationPitch;
if (cel.value) {rotation();}
mc.player.setSprinting(false);
attackTarget();
if (cel.value) {
mc.player.rotationYaw = originalYaw;
mc.player.rotationPitch = originalPitch;
}
} else {
resetRotation();
}
}
}
`` кароч ротация с свободной камерой но урон проходит есле игрок наводит камеру,как исправить? я кароч питался офнуть авто наводку камери в игре но ет не к чему не превело,вот и вишел на етот варянт,урона нету не регаер только есле игрок наведет камеру на хит бокс или рядом с хитом