Camellias_

Untitled

May 31st, 2018
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.70 KB | None | 0 0
  1. @Override
  2.     public void onWornTick(ItemStack itemstack, EntityLivingBase player)
  3.     {
  4.         if(player.isPotionActive(MobEffects.POISON) || player.isPotionActive(MobEffects.WITHER))
  5.         {
  6.             player.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 1, 20 * 15, true, true));
  7.             player.removePotionEffect(MobEffects.POISON);
  8.             player.removePotionEffect(MobEffects.WITHER);
  9.         }
  10.        
  11.         if(player.isPotionActive(MobEffects.BLINDNESS))
  12.         {
  13.             player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, 1, 20 * 15, true, true));
  14.             player.removePotionEffect(MobEffects.BLINDNESS);
  15.         }
  16.        
  17.         if(player.isPotionActive(MobEffects.HUNGER))
  18.         {
  19.             player.addPotionEffect(new PotionEffect(MobEffects.SATURATION, 1, 20 * 15, true, true));
  20.             player.removePotionEffect(MobEffects.HUNGER);
  21.         }
  22.        
  23.         if(player.isPotionActive(MobEffects.MINING_FATIGUE))
  24.         {
  25.             player.addPotionEffect(new PotionEffect(MobEffects.HASTE, 1, 20 * 15, true, true));
  26.             player.removePotionEffect(MobEffects.MINING_FATIGUE);
  27.         }
  28.        
  29.         if(player.isPotionActive(MobEffects.SLOWNESS))
  30.         {
  31.             player.addPotionEffect(new PotionEffect(MobEffects.SPEED, 1, 20 * 15, true, true));
  32.             player.removePotionEffect(MobEffects.SLOWNESS);
  33.         }
  34.        
  35.         if(player.isPotionActive(MobEffects.UNLUCK))
  36.         {
  37.             player.addPotionEffect(new PotionEffect(MobEffects.LUCK, 1, 20 * 15, true, true));
  38.             player.removePotionEffect(MobEffects.UNLUCK);
  39.         }
  40.        
  41.         if(player.isPotionActive(MobEffects.WEAKNESS))
  42.         {
  43.             player.addPotionEffect(new PotionEffect(MobEffects.STRENGTH, 1, 20 * 15, true, true));
  44.             player.removePotionEffect(MobEffects.WEAKNESS);
  45.         }
  46.        
  47.         if(player.isPotionActive(MobEffects.NAUSEA))
  48.         {
  49.             player.removePotionEffect(MobEffects.NAUSEA);
  50.         }
  51.     }
Advertisement
Add Comment
Please, Sign In to add comment