-
Автор темы
- #1
Перед прочтением основного контента ниже, пожалуйста, обратите внимание на обновление внутри секции Майна на нашем форуме. У нас появились:
- бесплатные читы для Майнкрафт — любое использование на свой страх и риск;
- маркетплейс Майнкрафт — абсолютно любая коммерция, связанная с игрой, за исключением продажи читов (аккаунты, предоставления услуг, поиск кодеров читов и так далее);
- приватные читы для Minecraft — в этом разделе только платные хаки для игры, покупайте группу "Продавец" и выставляйте на продажу свой софт;
- обсуждения и гайды — всё тот же раздел с вопросами, но теперь модернизированный: поиск нужных хаков, пати с игроками-читерами и другая полезная информация.
Спасибо!
Код:
package ru.nashon.module.impl.Combat;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screen.ChatScreen;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.MobEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.*;
import net.minecraft.network.play.client.CHeldItemChangePacket;
import net.minecraft.network.play.client.CPlayerTryUseItemOnBlockPacket;
import net.minecraft.network.play.client.CUseEntityPacket;
import net.minecraft.util.Hand;
import net.minecraft.util.math.vector.Vector2f;
import net.minecraft.util.math.vector.Vector3d;
import ru.nashon.Hattori;
import ru.nashon.helper.animation.Animation;
import ru.nashon.helper.animation.Counter;
import ru.nashon.helper.animation.Direction;
import ru.nashon.helper.animation.impl.EaseInOutQuad;
import ru.nashon.helper.blink.BlinkComponent;
import ru.nashon.helper.event.EventTarget;
import ru.nashon.helper.event.events.impl.EventMotion;
import ru.nashon.helper.event.events.impl.EventPacket;
import ru.nashon.helper.event.events.impl.EventUpdate;
import ru.nashon.helper.settings.options.BooleanSetting;
import ru.nashon.helper.settings.options.ListSetting;
import ru.nashon.helper.settings.options.ModeSetting;
import ru.nashon.helper.settings.options.SliderSetting;
import ru.nashon.helper.util.math.MathHelper;
import ru.nashon.module.Category;
import ru.nashon.module.Module;
import ru.nashon.module.impl.IModule;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import static net.minecraft.util.math.MathHelper.wrapDegrees;
@IModule(name = "KillAura", category = Category.Combat)
public class KillAura extends Module {
public SliderSetting range = new SliderSetting("Range", 3, 3, 6, 0.1f);
public SliderSetting prerange = new SliderSetting("Pre Range", 1, 0, 6, 0.1f);
public ListSetting targetsP = new ListSetting("Targets", "Player", "Mobs");
public BooleanSetting shieldBreaker = new BooleanSetting("Shield Breaker", true);
public BooleanSetting shieldDesync = new BooleanSetting("Shield Desync", true);
public BooleanSetting shieldHelper = new BooleanSetting("Shield Helper", true);
public BooleanSetting crit = new BooleanSetting("Only Crit", true);
public ModeSetting mode = new ModeSetting("Rotation", "RW", "RW", "Sunrise");
public static LivingEntity target;
public static List<LivingEntity> targets = new ArrayList<>();
public Vector2f rotation;
public float rotYaw = 0;
public float rotPitch = 0;
public KillAura() {
addSettings(mode, targetsP, range, prerange, crit, shieldBreaker, shieldHelper, shieldDesync);
}
@EventTarget
public void onUpdate2(EventMotion e) {
}
@EventTarget
public void onUpdate(EventMotion e) {
setSuffix(mode.get());
animation.setDirection(target!=null ? Direction.FORWARDS : Direction.BACKWARDS);
rotYaw = ((float) (animation.getOutput() * rotation.x));
rotPitch = rotation.y;
if (target != null && target.getHealth() <= 0 || target != null && target.removed) {
target = null;
BlinkComponent.blinking = false;
} else {
BlinkComponent.blinking = true;
if (mode.is("RW")) {
if (mayAttack()) {
if (getDistanceAura(target) >= range.get() + prerange.get())
target = null;
if (target != null) {
// mc.player.setSprinting(false);
e.setPitch(rotPitch);
e.setYaw(rotYaw);
mc.player.rotationYawHead = rotYaw;
mc.player.prevRotationPitch = 30;
mc.player.renderYawOffset = rotYaw;
}
}
if (getDistanceAura(target) >= range.get() + prerange.get()) {
target = null;
}
if (target != null) {
mc.player.rotationYawHead = rotYaw;
mc.player.prevRotationPitch = 30;
mc.player.renderYawOffset = rotYaw;
// mc.player.rotationYaw = (float) (animation.getOutput() * rotYaw);
}
} else {
if (getDistanceAura(target) >= range.get() + prerange.get())
target = null;
if (target != null) {
e.setPitch(rotPitch);
e.setYaw(rotYaw);
mc.player.rotationYawHead = rotYaw;
mc.player.prevRotationPitch = rotPitch;
mc.player.renderYawOffset = rotYaw;
}
}
}
}
public static void calculateSilentMove(float yaw) {
}
public boolean mayAttack() {
if (crit.get())
return mc.player.fallDistance > 0 && !mc.player.isInWater() && !mc.player.isInLava();
else
return true;
}
public Counter timer = new Counter();
@EventTarget
public void onPacket(EventPacket e) {
if (target != null) {
if (e.getPacket() instanceof CUseEntityPacket) {
CUseEntityPacket p = (CUseEntityPacket) e.getPacket();
if (!(p.getAction() == CUseEntityPacket.Action.ATTACK)) {
e.cancel();
}
}
if (e.getPacket() instanceof CPlayerTryUseItemOnBlockPacket) {
CPlayerTryUseItemOnBlockPacket p = (CPlayerTryUseItemOnBlockPacket) e.getPacket();
// if (p.getHand() == Hand.OFF_HAND)
// e.cancel();
}
}
}
@EventTarget
public void onUpdate(EventUpdate e) {
findTarget();
if (target != null) {
rotate();
if (shieldDesync.get() && target.getActiveItemStack().getItem() instanceof ShieldItem && timer.hasReached(MathHelper.getRandomNumberBetween(100, 400))) {
mc.playerController.onStoppedUsingItem(mc.player);
}
if (getDistanceAura(target) <= range.get()) {
if (mc.player.getCooledAttackStrength(0) >= 0.93) {
if (shieldHelper.get()) {
if (mc.player.isActiveItemStackBlocking()) {
mc.playerController.onStoppedUsingItem(mc.player);
}
}
if (mayAttack()) {
mc.player.setSprinting(false);
rX = mode.is("Matrix") ? (Math.sin(System.nanoTime()) / 1000000000f) / MathHelper.getRandomNumberBetween(80, 100) : 0;
rY = mode.is("Matrix") ? (Math.cos(System.nanoTime()) / 1000000000f) / MathHelper.getRandomNumberBetween(80, 100) : 0;
rZ = -(mode.is("Matrix") ? Math.cos(System.nanoTime() / 1000000000f) / MathHelper.getRandomNumberBetween(80, 100) : 0);
rotYaw = rotation.x;
rotPitch = rotation.y;
if (getAxe() >= 0 && shieldBreaker.get() && target instanceof PlayerEntity
&& isActiveItemStackBlocking((PlayerEntity) target, 1)) {
mc.player.connection.sendPacket(new CHeldItemChangePacket(getAxe()));
shieldBreaker((PlayerEntity) target);
mc.player.connection.sendPacket(new CHeldItemChangePacket(mc.player.inventory.currentItem));
}
mc.playerController.attackEntity(mc.player, target);
mc.player.swingArm(Hand.MAIN_HAND);
mc.player.resetCooldown();
}
}
}
}
}
public static boolean isActiveItemStackBlocking(PlayerEntity other, int time) {
if (other.isHandActive() && !other.getActiveItemStack().isEmpty()) {//isEntity()
Item item = other.getActiveItemStack().getItem();
if (item.getUseAction(other.getActiveItemStack()) != UseAction.BLOCK) {
return false;
} else {
return item.getUseDuration(other.getActiveItemStack()) - other.getItemInUseCount() >= time;
}
} else {
return false;
}
}
public void shieldBreaker(PlayerEntity base) {
mc.playerController.attackEntity(mc.player, base);
mc.player.swingArm(Hand.MAIN_HAND);
}
public static int getAxe() {
for (int i = 0; i < 9; i++) {
ItemStack s = mc.player.inventory.getStackInSlot(i);
if (s.getItem() instanceof AxeItem) {
return i;
}
}
return -1;
}
public float getFixedRotation(float rot) {
return getDeltaMouse(rot) * getGCDValue();
}
public float getGCDValue() {
return (float) (getGCD() * 0.15);
}
public float getGCD() {
float f1;
return (f1 = (float) (mc.gameSettings.mouseSensitivity * 0.6 + 0.2)) * f1 * f1 * 8;
}
public float getDeltaMouse(float delta) {
return Math.round(delta / getGCDValue());
}
public int findAxe() {
for (int i = 0; i < 9; i++) {
if (mc.player.inventory.getStackInSlot(i).getItem() instanceof AxeItem) {
return i;
}
}
return -1;
}
public double rX = 0;
public double rY = 0;
public double rZ = 0;
public Vector3d getVecTarget() {
double[] rax = mc.player.razXZ(target);
Vector3d vec = target.getPositionVec().add(new Vector3d(rax[0], MathHelper.clamp(target.getEyeHeight() * (mc.player.getDistance(target) / (range.get() + target.getWidth())), 0.2f, mc.player.getEyeHeight()), rax[1]));
if (!isHitBoxVisible(vec)) {
for (double i = target.getWidth() * 0.05; i <= target.getWidth() * 0.95; i += target.getWidth() * 0.9 / 8f) {
for (double j = target.getWidth() * 0.05; j <= target.getWidth() * 0.95; j += target.getWidth() * 0.9 / 8f) {
for (double k = 0; k <= target.getHeight(); k += target.getHeight() / 8f) {
if (isHitBoxVisible(new Vector3d(i, k, j).add(target.getPositionVec().add(new Vector3d(-target.getWidth() / 2, 0, -target.getWidth() / 2))))) {
vec = new Vector3d(i, k, j).add(target.getPositionVec().add(new Vector3d(-target.getWidth() / 2, 0, -target.getWidth() / 2)));
break;
}
}
}
}
}
return vec;
}
boolean isHitBoxVisible(Vector3d vec3d) {
final Vector3d eyesPos = new Vector3d(mc.player.getPosX(), mc.player.getBoundingBox().minY + mc.player.getEyeHeight(), mc.player.getPosZ());
return mc.world.rayTraceBlocks(eyesPos, vec3d, null, null, null) == null;
}
public Animation animation = new EaseInOutQuad(250, 1);
public void rotate() {
animation.setDirection(target!=null ? Direction.FORWARDS : Direction.BACKWARDS);
if(mode.is("Sunrise")) {
double xDiff = (mode.is("Sunrise") ? target.getPosX() : getVecTarget().x) - mc.player.getPosX() + rX + (mode.is("Sunrise") ? target.getPosX() - target.prevPosX : 0);
double yDiff = (mode.is("Sunrise") ? target.getPosY() : getVecTarget().y) - mc.player.getPosY() - mc.player.getEyeHeight() + 0.3f - (getDistanceAura(target) > 1 ? rY : 0) + (mode.is("Sunrise") ? 1 : 0) + (mode.is("Sunrise") ? target.getPosY() - target.prevPosY : 0);
double zDiff = (mode.is("Sunrise") ? target.getPosZ() : getVecTarget().z) - mc.player.getPosZ() - rZ + (mode.is("Sunrise") ? target.getPosZ() - target.prevPosZ : 0);
double yaw = getFixedRotation((float) (wrapDegrees(Math.toDegrees(Math.atan2(zDiff, xDiff)) - 90)) + MathHelper.getRandomNumberBetween(-2, 2));
double pitch = getFixedRotation((float) wrapDegrees(Math.toDegrees(-Math.atan2(yDiff, Math.hypot(xDiff, zDiff)))) + MathHelper.getRandomNumberBetween(-2, 2));
pitch = MathHelper.clamp((float) pitch, -90, 90);
rotation = new Vector2f((float) yaw, (float) pitch);
}
if(mode.is("RW")) {
double xDiff = animation.getOutput() * ((mode.is("RW") ? target.getPosX() : getVecTarget().x) - mc.player.getPosX() + rX + (mode.is("RW") ? target.getPosX() - target.prevPosX : 0));
double yDiff = (mode.is("RW") ? target.getPosY() : getVecTarget().y) - mc.player.getPosY() - mc.player.getEyeHeight() + 0.3f - (getDistanceAura(target) > 1 ? rY : 0) + (mode.is("RW") ? 1 : 0) + (mode.is("RW") ? target.getPosY() - target.prevPosY : 0);
double zDiff = animation.getOutput() * ((mode.is("RW") ? target.getPosZ() : getVecTarget().z) - mc.player.getPosZ() - rZ + (mode.is("RW") ? target.getPosZ() - target.prevPosZ : 0));
double yaw = animation.getOutput() * (getFixedRotation((float) ((wrapDegrees(Math.toDegrees(Math.atan2(zDiff, xDiff)) - 90)) + MathHelper.getRandomNumberBetween(-2, 2))));
double pitch = getFixedRotation((float) wrapDegrees(Math.toDegrees(-Math.atan2(yDiff, Math.hypot(xDiff, zDiff)))) + MathHelper.getRandomNumberBetween(-2, 2));
pitch = MathHelper.clamp((float) pitch, -90, 90);
rotation = new Vector2f((float) (animation.getOutput() * (float) yaw), (float) pitch);
// this.rotation = new Vector2f(mc.player.rotationYaw, mc.player.rotationPitch);
}
}
public float getDistanceAura(Entity entityIn) {
float f = (float) (mc.player.getPosX() - (entityIn.getPosX() + mc.player.razXZ(entityIn)[0]));
float f1 = (float) (mc.player.getPosY() - entityIn.getPosY());
float f2 = (float) (mc.player.getPosZ() - entityIn.getPosZ() + mc.player.razXZ(entityIn)[1]);
return net.minecraft.util.math.MathHelper.sqrt(f * f + f1 * f1 + f2 * f2);
}
public boolean isValidTarget(Entity e) {
if (e == mc.player) return false;
if (e.removed) return false;
if (AntiBot.isBot.contains(e)) return false;
if (getDistanceAura(e) > range.get() + prerange.get()) return false;
if (Hattori.friend.isFriend(e.getName().getString())) return false;
if (e instanceof PlayerEntity && targetsP.selected.contains("Player")) return true;
if (e instanceof MobEntity && targetsP.selected.contains("Mobs")) return true;
return false;
}
@Override
public void onDisable() {
super.onDisable();
if (mc.player != null) {
rotYaw = mc.player.rotationYaw;
rotPitch = mc.player.rotationPitch;
}
target = null;
targets.clear();
}
public void findTarget() {
targets.clear();
for (Entity entity : mc.world.getPlayers()) {
if (entity instanceof LivingEntity) {
LivingEntity entityLivingBase = (LivingEntity) entity;
if (mc.player.getDistance(entity) <= range.get() + this.prerange.get() && isValidTarget(entity) && mc.player != entityLivingBase) {
targets.add(entityLivingBase);
}
}
}
target = targets.get(0);
targets.sort(Comparator.comparingDouble(mc.player::getDistance));
}
}