SHARE
TWEET

KillAura

a guest May 26th, 2019 189 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package modules;
  2.  
  3. import java.util.List;
  4.  
  5. import org.lwjgl.input.Keyboard;
  6.  
  7. import com.ibm.icu.util.BytesTrie.Iterator;
  8.  
  9. import me.WizardPros.module.Category;
  10. import me.WizardPros.module.Module;
  11. import net.minecraft.client.Minecraft;
  12. import net.minecraft.client.entity.EntityPlayerSP;
  13. import net.minecraft.entity.Entity;
  14. import net.minecraft.entity.EntityLivingBase;
  15. import net.minecraft.entity.player.EntityPlayer;
  16. import net.minecraft.network.play.client.C02PacketUseEntity;
  17. import net.minecraft.network.play.client.C03PacketPlayer;
  18. import net.minecraft.network.play.client.C07PacketPlayerDigging;
  19. import net.minecraft.network.play.client.C07PacketPlayerDigging.Action;
  20. import net.minecraft.util.BlockPos;
  21. import net.minecraft.util.EnumFacing;
  22. import net.minecraft.util.MathHelper;
  23.  
  24. public class KillAura extends Module {
  25.     Minecraft mc = Minecraft.getMinecraft();
  26.     public static float yaw;
  27.     public static float pitch;
  28.     public static int Enabled = 0;
  29.    
  30.  
  31.     public KillAura() {
  32.         super("KillAura", Keyboard.KEY_R, Category.COMBAT);
  33.         // TODO Auto-generated constructor stub
  34.     }
  35.     public void onEnable() {
  36.         Enabled = 1;
  37.     }
  38.     public void onDisable() {
  39.         Enabled = 0;
  40.     }
  41.    
  42.    
  43.            
  44.             public void onUpdate() {
  45.                 if (this.getState()) {
  46.                     this.killaura();
  47.                 }
  48.             }
  49.  
  50.             int delay;
  51.  
  52.             private void killaura() {
  53.                 List list = mc.theWorld.playerEntities;
  54.                 delay++;
  55.  
  56.                 for (int k = 0; k < list.size(); k++) {
  57.                     if (((EntityPlayer) list.get(k)).getName() == mc.thePlayer.getName()) {
  58.                         continue;
  59.                     }
  60.  
  61.                     EntityPlayer entityplayer = (EntityPlayer) list.get(1);
  62.  
  63.                     if (mc.thePlayer.getDistanceToEntity(entityplayer) > mc.thePlayer.getDistanceToEntity((Entity) list.get(k))) {
  64.                         entityplayer = (EntityPlayer) list.get(k);
  65.                     }
  66.                     if(mc.thePlayer.isBlocking()) {
  67.                          mc.thePlayer.sendQueue.addToSendQueue(new C07PacketPlayerDigging(Action.RELEASE_USE_ITEM, new BlockPos(0, 0, 0), EnumFacing.UP));
  68.                     }
  69.  
  70.                     float f = mc.thePlayer.getDistanceToEntity(entityplayer);
  71.                     boolean Block = true;
  72.                     if (f < 4F && mc.thePlayer.canEntityBeSeen(entityplayer) && delay > 5.0) {
  73.                         if(Block && mc.thePlayer.getHeldItem() != null) {
  74.                             mc.thePlayer.setItemInUse(mc.thePlayer.getHeldItem(), mc.thePlayer.getHeldItem().getMaxItemUseDuration());
  75.                         }
  76.                         float[] rotations = getRotationsNeeded(entityplayer);
  77.                          yaw = rotations[0];
  78.                          pitch = rotations[1] + 8;
  79.                         mc.thePlayer.swingItem();
  80.                         mc.thePlayer.sendQueue.addToSendQueue(new C02PacketUseEntity(entityplayer, C02PacketUseEntity.Action.ATTACK));
  81.                        
  82.                        
  83.                        
  84.                         delay = 0;
  85.                         continue;
  86.                     }
  87.                 }
  88.             }
  89.  
  90.            
  91.            
  92.  
  93.             public static float[] getRotationsNeeded(Entity entity)
  94.             {
  95.                 if(entity == null)
  96.                     return null;
  97.                 double diffX = entity.posX - Minecraft.getMinecraft().thePlayer.posX;
  98.                 double diffY;
  99.                 if(entity instanceof EntityLivingBase)
  100.                 {
  101.                     EntityLivingBase entityLivingBase = (EntityLivingBase)entity;
  102.                     diffY =
  103.                         entityLivingBase.posY
  104.                             + entityLivingBase.getEyeHeight()
  105.                             * 0.9
  106.                             - (Minecraft.getMinecraft().thePlayer.posY + Minecraft
  107.                                 .getMinecraft().thePlayer.getEyeHeight());
  108.                 }else
  109.                     diffY =
  110.                         (entity.boundingBox.minY + entity.boundingBox.maxY)
  111.                             / 2.0D
  112.                             - (Minecraft.getMinecraft().thePlayer.posY + Minecraft
  113.                                 .getMinecraft().thePlayer.getEyeHeight());
  114.                 double diffZ = entity.posZ - Minecraft.getMinecraft().thePlayer.posZ;
  115.                 double dist = MathHelper.sqrt_double(diffX * diffX + diffZ * diffZ);
  116.                 float yaw =
  117.                     (float)(Math.atan2(diffZ, diffX) * 180.0D / Math.PI) - 90.0F;
  118.                 float pitch = (float)-(Math.atan2(diffY, dist) * 180.0D / Math.PI);
  119.                 return new float[]{
  120.                     Minecraft.getMinecraft().thePlayer.rotationYaw
  121.                         + MathHelper.wrapAngleTo180_float(yaw
  122.                             - Minecraft.getMinecraft().thePlayer.rotationYaw),
  123.                     Minecraft.getMinecraft().thePlayer.rotationPitch
  124.                         + MathHelper.wrapAngleTo180_float(pitch
  125.                             - Minecraft.getMinecraft().thePlayer.rotationPitch)};
  126.                
  127.             }
  128.             public static void look() {
  129.                 Minecraft.getMinecraft().thePlayer.sendQueue.addToSendBypassQueue(new C03PacketPlayer.C05PacketPlayerLook(yaw, pitch, Minecraft.getMinecraft().thePlayer.onGround));
  130.             }
  131.             public static void Poslook() {
  132.                 Minecraft.getMinecraft().thePlayer.sendQueue.addToSendBypassQueue(new C03PacketPlayer.C06PacketPlayerPosLook(Minecraft.getMinecraft().thePlayer.posX, Minecraft.getMinecraft().thePlayer.getEntityBoundingBox().minY, Minecraft.getMinecraft().thePlayer.posZ, yaw, pitch, Minecraft.getMinecraft().thePlayer.onGround));
  133.             }
  134.            
  135.            
  136.            
  137.          }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top