Advertisement
Guest User

Untitled

a guest
Sep 15th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.67 KB | None | 0 0
  1. @SubscribeEvent
  2.         public void giveFlu(LivingUpdateEvent event)
  3.         {
  4.            
  5.             System.out.print("You are updated!");
  6.             if(event.entityLiving instanceof EntityPlayer)
  7.             {
  8.                 EntityPlayer player1 = (EntityPlayer)event.entityLiving;
  9.                 EntityPlayer player2 = player1.worldObj.getClosestPlayerToEntity(player1, 2);
  10.                        
  11.                 if(player2 != null)
  12.                 {
  13.                     System.out.print("You got the method right!");
  14.                     if(player1.getActivePotionEffect(EpidemicCraft.potionFlu) != null)
  15.                     {
  16.                         System.out.print("Potion added! 1.7.10 is done!");
  17.                         ((EntityLivingBase)player2).addPotionEffect(new PotionEffect(EpidemicCraft.potionFlu.id, 1000, 0));
  18.                     }
  19.                 }
  20.             }
  21.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement