package me.km.effects.active; import me.km.api.Utils; import me.km.effects.ActiveEffectBase; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.MobEffects; import net.minecraft.potion.PotionEffect; import net.minecraft.util.math.Vec3d; public class Kick extends ActiveEffectBase { @Override protected boolean executeEffect(EntityPlayerMP p, int power) { EntityLivingBase liv = Utils.getTargetedEntity(p, 4, EntityLivingBase.class); if(liv == null) { return false; } Vec3d v = liv.getPositionVector().subtract(p.getPositionVector()).normalize().scale(2).addVector(0, 0.4, 0); Utils.setVelocity(liv, v.x, v.y, v.z); liv.addPotionEffect(new PotionEffect(MobEffects.NAUSEA, 120, 10)); return true; } @Override protected int getManaCost(int manaFactor) { return 4 * manaFactor; } }