12345678910111213141516171819202122232425 |
- 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.util.DamageSource;
- public class Smash extends ActiveEffectBase
- {
- @Override
- protected boolean executeEffect(EntityPlayerMP p, int power)
- {
- EntityLivingBase liv = Utils.getTargetedEntity(p, 4, EntityLivingBase.class);
- if(liv == null)
- {
- return false;
- }
- DamageSource ds = DamageSource.causePlayerDamage(p);
- ds.setDamageBypassesArmor();
- ds.setDamageIsAbsolute();
- liv.attackEntityFrom(ds, power);
- return true;
- }
- }
|