Guest User

Untitled

a guest
Jan 18th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. package com.aspectdev.aspect.hacks;
  2.  
  3. import java.io.IOException;
  4.  
  5. import net.minecraft.client.Minecraft;
  6. import net.minecraft.src.Entity;
  7. import net.minecraft.src.EntityAnimal;
  8. import net.minecraft.src.EntityLiving;
  9. import net.minecraft.src.EntityMob;
  10. import net.minecraft.src.EntityPlayer;
  11. import net.minecraft.src.MathHelper;
  12. import net.minecraft.src.Packet12PlayerLook;
  13. import net.minecraft.src.Packet13PlayerLookMove;
  14. import net.minecraft.src.Packet18Animation;
  15. import net.minecraft.src.Packet7UseEntity;
  16. public class KillAura extends Thread {
  17.  
  18. public static Minecraft mc = Minecraft.getMinecraft();
  19. private static float hitDistance = 4F;
  20.  
  21.  
  22. public void run()
  23. {
  24. for (Object o : mc.theWorld.loadedEntityList) {
  25. Entity e = (Entity) o;
  26. boolean a = (e != mc.thePlayer) && (!e.isDead);
  27. boolean b = (mc.thePlayer.getDistanceToEntity(e) <= 5D);
  28. boolean c = (mc.thePlayer.canEntityBeSeen(e));
  29. boolean d = (e instanceof EntityLiving);
  30. boolean canKill = (a && b && c & d);
  31. if (canKill){
  32. try{
  33. Thread.sleep(160);
  34. lookAtEntity(e);
  35. mc.thePlayer.swingItem();
  36. mc.thePlayer.sendQueue.addToSendQueue(new Packet7UseEntity(mc.thePlayer.entityId, e.entityId, 1));
  37. Thread.sleep(160);
  38. } catch (InterruptedException e1) {
  39. // TODO Auto-generated catch block
  40. e1.printStackTrace();
  41. }
  42. }
  43. }
  44.  
  45. }
  46.  
  47. public static void lookAtEntity(Entity e)
  48. {
  49. if (e != mc.thePlayer && !e.isDead && mc.thePlayer.getDistanceToEntity(e) <= 5D)
  50. {
  51. double d = e.posX - e.posX;
  52. double d2 = e.posZ - e.posZ;
  53. double d1 = e.posY - e.posY;
  54. double d3 = MathHelper.sqrt_double(d * d + d2 * d2);
  55. double d4 = (mc.thePlayer.posY + (double)mc.thePlayer.getEyeHeight()) - (e.posY + (double)e.getEyeHeight());
  56. float f = (float)((Math.atan2(d2, d) * 180D) / Math.PI) - 90F;
  57. float f1 = (float)(-((Math.atan2(d1, d3) * 180D) / Math.PI));
  58. float f2 = (float) (((Math.atan2(d4, d3) * 180D) / Math.PI));
  59. double st = mc.thePlayer.boundingBox.minY - (mc.thePlayer.onGround ? 0.0001D : 0.0D);
  60. mc.thePlayer.sendQueue.addToSendQueue(new Packet13PlayerLookMove(mc.thePlayer.posX, st, mc.thePlayer.posY, mc.thePlayer.posZ, f, f1, mc.thePlayer.onGround));
  61. }
  62. }
  63.  
  64. }
Add Comment
Please, Sign In to add comment