Advertisement
Guest User

KillAura

a guest
Mar 21st, 2017
16,639
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. public class KillAura extends Mod{
  2. private int ticks = 0;
  3. public KillAura() {
  4. super("KillAura", "KillAura", Keyboard.KEY_R, Category.COMBAT);
  5. }
  6. public void onUpdate(){
  7. if(this.isToggled()){
  8. ticks++;
  9. if(ticks >= 20 - speed()){
  10. ticks = 0;
  11. for(Iterator<Entity> entities = mc.theWorld.loadedEntityList.iterator(); entities.hasNext();) {
  12. Object theObject = entities.next();
  13. if(theObject instanceof EntityLivingBase) {
  14. EntityLivingBase entity = (EntityLivingBase) theObject;
  15.  
  16. if(entity instanceof EntityPlayerSP) continue;
  17.  
  18. if(mc.thePlayer.getDistanceToEntity(entity) <= 7F) {
  19.  
  20. if(entity.isInvisible()){
  21. break;
  22. }
  23. if(entity.isEntityAlive()) {
  24. if(mc.thePlayer.getHeldItem() != null){
  25. mc.thePlayer.setItemInUse(mc.thePlayer.getHeldItem(), mc.thePlayer.getHeldItem().getMaxItemUseDuration());
  26. }
  27. if(mc.thePlayer.isBlocking()){
  28. mc.thePlayer.sendQueue.addToSendQueue(new C07PacketPlayerDigging(Action.RELEASE_USE_ITEM, new BlockPos(0, 0, 0), EnumFacing.UP));
  29. }
  30.  
  31. mc.thePlayer.sendQueue.addToSendQueue(new C02PacketUseEntity(entity, C02PacketUseEntity.Action.ATTACK));
  32. mc.thePlayer.swingItem();
  33. break;
  34. }
  35. }
  36. }
  37. }
  38. }
  39. }
  40. }
  41. private int speed() {
  42. return 18;
  43. }
  44.  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement