12345678910111213141516171819202122232425 |
- package me.km.effects.active;
- import me.km.api.Utils;
- import me.km.effects.ActiveEffectBase;
- import me.km.effects.EffectUtils;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.player.EntityPlayerMP;
- import net.minecraft.init.MobEffects;
- import net.minecraft.util.DamageSource;
- public class StunPunch extends ActiveEffectBase
- {
- @Override
- protected boolean executeEffect(EntityPlayerMP p, int power)
- {
- EntityLivingBase liv = Utils.getTargetedEntity(p, 4, EntityLivingBase.class);
- if(liv == null)
- {
- return false;
- }
- liv.attackEntityFrom(DamageSource.causePlayerDamage(p), 0.125f);
- EffectUtils.addPotionTo(liv, MobEffects.SLOWNESS, 10 * power, 50);
- return true;
- }
- }
|