SHARE
TWEET

Untitled

a guest Feb 20th, 2020 141 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class AntiBot extends Module {
  2.   public static ArrayList<EntityPlayer> bots = new ArrayList<>();
  3.  
  4.   private TimerUtil timer = new TimerUtil();
  5.  
  6.   private EnumValue<Mode> mode = new EnumValue("Mode", Mode.HYPIXEL);
  7.  
  8.   public AntiBot() {
  9.     super("AntiBot", Module.Category.COMBAT, (new Color(153, 204, 255, 255)).getRGB());
  10.     setDescription("Add bots to a list of poop heads");
  11.     addValues(new Value[] { (Value)this.mode });
  12.   }
  13.  
  14.   @Subscribe
  15.   public void onUpdate(UpdateEvent event) {
  16.     setSuffix(StringUtils.capitalize(((Mode)this.mode.getValue()).name().toLowerCase()));
  17.     switch ((Mode)this.mode.getValue()) {
  18.       case HYPIXEL:
  19.         if (this.mc.getCurrentServerData() != null && this.mc.theWorld != null && (this.mc.getCurrentServerData()).serverIP.contains("hypixel"))
  20.           for (Object entities : this.mc.theWorld.loadedEntityList) {
  21.             if (entities instanceof EntityPlayer) {
  22.               EntityPlayer entity = (EntityPlayer)entities;
  23.               if (entity != this.mc.thePlayer &&
  24.                 this.mc.thePlayer.getDistanceToEntity((Entity)entity) < 10.0F && (
  25.                 !entity.getDisplayName().getFormattedText().startsWith(") || entity.isInvisible() || entity.getDisplayName().getFormattedText().toLowerCase().contains("npc")))
  26.                 bots.add(entity);
  27.               if (bots.contains(entity) && !entity.isInvisible())
  28.                 bots.remove(entity);
  29.             }
  30.           }  
  31.         break;
  32.       case MINEPLEX:
  33.         for (Object object : this.mc.theWorld.playerEntities) {
  34.           if (object instanceof EntityPlayer) {
  35.             EntityPlayer e = (EntityPlayer)object;
  36.             if (e.ticksExisted < 2 && e.getHealth() < 20.0F && e.getHealth() > 0.0F && e != this.mc.thePlayer)
  37.               this.mc.theWorld.removeEntity((Entity)e);
  38.           }
  39.         }
  40.         break;
  41.     }
  42.   }
  43.  
  44.   private enum Mode {
  45.     HYPIXEL, MINEPLEX;
  46.   }
  47.  
  48.   public void onEnable() {
  49.     bots.clear();
  50.   }
  51.  
  52.   public void onDisable() {
  53.     bots.clear();
  54.   }
  55.  
  56.   public static List<EntityPlayer> getBots() {
  57.     return bots;
  58.   }
  59. }
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
Top