Simple KillAura
-
like title
The aura has easy bypass and code is easy to readpackage net.ccbluex.liquidbounce.features.module.modules.combat; import de.enzaxd.viaforge.util.AttackOrder; import net.ccbluex.liquidbounce.event.EventTarget; import net.ccbluex.liquidbounce.event.UpdateEvent; import net.ccbluex.liquidbounce.event.StrafeEvent; import net.ccbluex.liquidbounce.features.module.Module; import net.ccbluex.liquidbounce.features.module.ModuleCategory; import net.ccbluex.liquidbounce.features.module.ModuleInfo; import net.ccbluex.liquidbounce.utils.Rotation; import net.ccbluex.liquidbounce.utils.RotationUtils; import net.ccbluex.liquidbounce.utils.EntityUtils; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.util.MathHelper; import java.util.*; import java.util.stream.Collectors; import java.util.concurrent.ThreadLocalRandom; @ModuleInfo(name = "SimpleAura", spacedName = "Simple Aura", description = "meow", category = ModuleCategory.COMBAT) public class SimpleAura extends Module { private Entity target; private float range = 3.0F; private double r2d = 57.29577951308232; // 180 / Math.PI: 弧度转角度 private TimerUtil t = new TimerUtil(); @Override public void onDisable() { target = null; t.reset(); } @Override public void onEnable() { if (mc.thePlayer == null) return; updateTarget(); } @EventTarget public void onStrafe(StrafeEvent event) { if (mc.currentScreen instanceof GuiContainer) return; updateTarget(); RotationUtils.targetRotation.applyStrafeToPlayer(event, !(mc.thePlayer.getDistanceToEntity(target) <= 1.13F || RotationUtils.getRotationDifference(target) >= 60F || Math.abs(getAngleOfLineAndPoint(target.posX, target.posY)) >= 37.5F)); event.cancelEvent(); } @EventTarget public void onUpdate(UpdateEvent event) { if (mc.currentScreen instanceof GuiContainer) return; ThreadLocalRandom random = ThreadLocalRandom.current(); if (mc.thePlayer.getDistanceToEntity(target) > range + 0.005F) { target = null; return; } RotationUtils.setTargetRotation(RotationUtils.limitAngleChange(RotationUtils.serverRotation, getRotations(target), random.nextFloat() * 84F + 78F), 1); if (t.delay(random.nextInt(100, 130))) { AttackOrder.sendFixedAttack(mc.thePlayer, target); t.reset(); } } private void updateTarget() { List<Entity> targets = new ArrayList<>(); for (Entity entity : getVisibleEntities()) { if (EntityUtils.isSelected(entity, true) && mc.thePlayer.getDistanceToEntity(entity) <= range && RotationUtils.getRotationDifference(entity) <= 180.0) { targets.add(entity); } } if (!targets.isEmpty()) target = Collections.min(targets, Comparator.comparingDouble(RotationUtils::getRotationDifference)); } private List<Entity> getVisibleEntities() { List<Entity> entities = new ArrayList<>(); for (Entity entity : mc.theWorld.loadedEntityList) { if (mc.thePlayer.getDistanceToEntity(entity) <= range && RotationUtils.isVisible(entity) && entity instanceof EntityLivingBase) { entities.add(entity); } } return entities; } private float getAngleOfLineAndPoint(double x, double z) { double diffX = x - mc.thePlayer.posX; double diffZ = z - mc.thePlayer.posZ; return (float) (Math.atan2(diffZ, diffX) * r2d) - 90F; // 用Arctan2函数算出原点O(mc.thePlayer.posX, mc.thePlayer.posZ) 与 点(x, z)所连成的线段与y轴形成的夹角的角度 } private Rotation getRotations(Entity entity) { double x = entity.posX - mc.thePlayer.posX; double y = entity.posY - (mc.thePlayer.posY + (double) mc.thePlayer.getEyeHeight()); double z = entity.posZ - mc.thePlayer.posZ; double dist = Math.hypot(x, z); float yaw = (float) (Math.atan2(z, x) * r2d) - 90.0f; float pitch = RotationUtils.isFaced(entity, range + 0.005D) ? MathHelper.clamp_float(mc.thePlayer.rotationPitch, 10F, 64F) : (float) (-(Math.atan2(y, dist) * r2d)); return new Rotation(yaw, pitch); } }
why 1tab = 8spaces,
me hate them
You need to import your TimerUtil -
MathHelper.clamp_float(mc.thePlayer.rotationPitch, 10F, 64F) are shit, everybody should remove it