Cripple.java 847 B

123456789101112131415161718192021222324252627282930
  1. package me.km.effects.active;
  2. import me.km.api.Utils;
  3. import me.km.effects.ActiveEffectBase;
  4. import net.minecraft.entity.EntityLivingBase;
  5. import net.minecraft.entity.player.EntityPlayerMP;
  6. import net.minecraft.init.MobEffects;
  7. import net.minecraft.potion.PotionEffect;
  8. public class Cripple extends ActiveEffectBase
  9. {
  10. @Override
  11. protected boolean executeEffect(EntityPlayerMP p, int power)
  12. {
  13. EntityLivingBase liv = Utils.getTargetedEntity(p, 4, EntityLivingBase.class);
  14. if(liv == null)
  15. {
  16. return false;
  17. }
  18. liv.addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, power * 20, 2));
  19. liv.addPotionEffect(new PotionEffect(MobEffects.NAUSEA, power * 20, 1));
  20. return true;
  21. }
  22. @Override
  23. protected int getManaCost(int manaFactor)
  24. {
  25. return 1;
  26. }
  27. }