TimedHeal.java 504 B

12345678910111213141516171819
  1. package me.km.effects.active;
  2. import me.km.KajetansMod;
  3. import me.km.effects.ActiveEffectBase;
  4. import net.minecraft.entity.player.EntityPlayerMP;
  5. public class TimedHeal extends ActiveEffectBase
  6. {
  7. @Override
  8. protected boolean executeEffect(EntityPlayerMP p, int power)
  9. {
  10. float amount = (p.getMaxHealth() * power) / 100F;
  11. for(int i = 1; i < 6; i++)
  12. {
  13. KajetansMod.scheduler.scheduleTask(() -> p.heal(amount), i * 20);
  14. }
  15. return true;
  16. }
  17. }