Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.aspectdev.aspect.hacks;
- import java.io.IOException;
- import net.minecraft.client.Minecraft;
- import net.minecraft.src.Entity;
- import net.minecraft.src.EntityAnimal;
- import net.minecraft.src.EntityLiving;
- import net.minecraft.src.EntityMob;
- import net.minecraft.src.EntityPlayer;
- import net.minecraft.src.MathHelper;
- import net.minecraft.src.Packet12PlayerLook;
- import net.minecraft.src.Packet13PlayerLookMove;
- import net.minecraft.src.Packet18Animation;
- import net.minecraft.src.Packet7UseEntity;
- public class KillAura extends Thread {
- public static Minecraft mc = Minecraft.getMinecraft();
- private static float hitDistance = 4F;
- public void run()
- {
- for (Object o : mc.theWorld.loadedEntityList) {
- Entity e = (Entity) o;
- boolean a = (e != mc.thePlayer) && (!e.isDead);
- boolean b = (mc.thePlayer.getDistanceToEntity(e) <= 5D);
- boolean c = (mc.thePlayer.canEntityBeSeen(e));
- boolean d = (e instanceof EntityLiving);
- boolean canKill = (a && b && c & d);
- if (canKill){
- try{
- Thread.sleep(160);
- lookAtEntity(e);
- mc.thePlayer.swingItem();
- mc.thePlayer.sendQueue.addToSendQueue(new Packet7UseEntity(mc.thePlayer.entityId, e.entityId, 1));
- Thread.sleep(160);
- } catch (InterruptedException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
- }
- }
- }
- public static void lookAtEntity(Entity e)
- {
- if (e != mc.thePlayer && !e.isDead && mc.thePlayer.getDistanceToEntity(e) <= 5D)
- {
- double d = e.posX - e.posX;
- double d2 = e.posZ - e.posZ;
- double d1 = e.posY - e.posY;
- double d3 = MathHelper.sqrt_double(d * d + d2 * d2);
- double d4 = (mc.thePlayer.posY + (double)mc.thePlayer.getEyeHeight()) - (e.posY + (double)e.getEyeHeight());
- float f = (float)((Math.atan2(d2, d) * 180D) / Math.PI) - 90F;
- float f1 = (float)(-((Math.atan2(d1, d3) * 180D) / Math.PI));
- float f2 = (float) (((Math.atan2(d4, d3) * 180D) / Math.PI));
- double st = mc.thePlayer.boundingBox.minY - (mc.thePlayer.onGround ? 0.0001D : 0.0D);
- mc.thePlayer.sendQueue.addToSendQueue(new Packet13PlayerLookMove(mc.thePlayer.posX, st, mc.thePlayer.posY, mc.thePlayer.posZ, f, f1, mc.thePlayer.onGround));
- }
- }
- }
Add Comment
Please, Sign In to add comment