Advertisement
Guest User

Untitled

a guest
Sep 26th, 2016
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.75 KB | None | 0 0
  1.         @SubscribeEvent
  2.         public void giveFlu(LivingUpdateEvent event)
  3.         {
  4.             if(event.entityLiving instanceof EntityPlayer)
  5.             {
  6.                 EntityPlayer player1 = (EntityPlayer)event.entityLiving;
  7.                                
  8.                 if(player1.getActivePotionEffect(EpidemicCraft.potionFlu)  != null)
  9.                 {
  10.                     List<EntityPlayer> list = player1.worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(player1.posX - 2, player1.posY - 2, player1.posZ - 2, player1.posX + 2, player1.posY + 2, player1.posZ + 2));                    
  11.  
  12.                     if(list != null)
  13.                     {
  14.                             Iterator<EntityPlayer> iterator = list.iterator();
  15.                             for (EntityPlayer temp : list) {
  16.                                 temp.addPotionEffect(new PotionEffect(EpidemicCraft.potionFlu.id, 1000, 0));
  17.                             }
  18.                     }
  19.                 }
  20.             }
  21.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement