diff --git a/src/main/java/com/windanesz/ancientspellcraft/spell/Hunger.java b/src/main/java/com/windanesz/ancientspellcraft/spell/Hunger.java index d6d852b9..405d0cda 100644 --- a/src/main/java/com/windanesz/ancientspellcraft/spell/Hunger.java +++ b/src/main/java/com/windanesz/ancientspellcraft/spell/Hunger.java @@ -5,6 +5,7 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.MobEffects; import net.minecraft.potion.PotionEffect; import net.minecraft.tileentity.TileEntityDispenser; @@ -31,6 +32,9 @@ protected boolean onEntityHit(World world, Entity target, Vec3d hit, EntityLivingBase targetEntity = (EntityLivingBase) target; targetEntity.addPotionEffect(new PotionEffect(MobEffects.HUNGER, getProperty(EFFECT_DURATION).intValue(), getProperty(EFFECT_STRENGTH).intValue())); + if (!(targetEntity instanceof EntityPlayer)) { + targetEntity.addPotionEffect(new PotionEffect(MobEffects.WEAKNESS, getProperty(EFFECT_DURATION).intValue(), getProperty(EFFECT_STRENGTH).intValue())); + } return true; } return false; diff --git a/src/main/java/com/windanesz/ancientspellcraft/spell/Starve.java b/src/main/java/com/windanesz/ancientspellcraft/spell/Starve.java index d837e028..caed8507 100644 --- a/src/main/java/com/windanesz/ancientspellcraft/spell/Starve.java +++ b/src/main/java/com/windanesz/ancientspellcraft/spell/Starve.java @@ -6,6 +6,7 @@ import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.MobEffects; import net.minecraft.tileentity.TileEntityDispenser; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumParticleTypes; @@ -36,6 +37,11 @@ protected boolean onEntityHit(World world, Entity target, Vec3d hit, targetPlayer.getFoodStats().addExhaustion((int) (saturation / 2)); return true; + } else if (target instanceof EntityLivingBase) { + EntityLivingBase entityLivingBase = (EntityLivingBase) target; + entityLivingBase.addPotionEffect(new net.minecraft.potion.PotionEffect(net.minecraft.init.MobEffects.HUNGER, 200, 2)); + entityLivingBase.addPotionEffect(new net.minecraft.potion.PotionEffect(MobEffects.SLOWNESS, 200, 1)); + entityLivingBase.addPotionEffect(new net.minecraft.potion.PotionEffect(MobEffects.WEAKNESS, 200, 1)); } return false; }