use of net.minecraft.potion.PotionEffect in project Bewitchment by Um-Mitternacht.
the class SpellSelfHeal method performEffect.
@Override
public void performEffect(RayTraceResult rtrace, EntityLivingBase caster, World world) {
if (caster != null) {
caster.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 160, 0, false, true));
caster.addPotionEffect(new PotionEffect(MobEffects.HUNGER, 160, 0, false, false));
}
}
use of net.minecraft.potion.PotionEffect in project Bewitchment by Um-Mitternacht.
the class PotionBloodDrained method performEffect.
@Override
public void performEffect(EntityLivingBase entity, int amplifier) {
IBloodReserve br = entity.getCapability(CapabilityBloodReserve.CAPABILITY, null);
float amount = br.getPercentFilled();
if (amount > 0 && amount < TRESHOLD) {
if (br.getDrinkerUUID() != null)
entity.attackEntityFrom(new DamageSourceDrain(entity.world.getPlayerEntityByUUID(br.getDrinkerUUID())), 0.5f);
if (br.getDrinkerUUID() != null)
entity.setRevengeTarget(entity.world.getPlayerEntityByUUID(br.getDrinkerUUID()));
entity.addPotionEffect(new PotionEffect(this, 200, amplifier));
} else {
entity.removePotionEffect(this);
br.setDrinker(null);
}
}
use of net.minecraft.potion.PotionEffect in project Bewitchment by Um-Mitternacht.
the class RitualConjurationWitch method onFinish.
@Override
public void onFinish(EntityPlayer player, TileEntity tile, World world, BlockPos pos, NBTTagCompound data) {
if (!world.isRemote) {
EntityWitch witch = new EntityWitch(world);
witch.setLocationAndAngles(pos.getX(), pos.getY(), pos.getZ(), (float) (Math.random() * 360), 0);
witch.onInitialSpawn(world.getDifficultyForLocation(new BlockPos(witch)), (IEntityLivingData) null);
world.spawnEntity(witch);
if (Math.random() < 0.1)
witch.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 6000, 2, false, false));
}
}
use of net.minecraft.potion.PotionEffect in project Bewitchment by Um-Mitternacht.
the class BrewUtils method serialize.
public static NBTTagCompound serialize(Collection<Object> collection) {
List<BrewEffect> brewEffects = new ArrayList<>();
List<PotionEffect> potionEffects = new ArrayList<>();
for (Object brew : collection) {
if (brew instanceof BrewEffect) {
brewEffects.add((BrewEffect) brew);
} else if (brew instanceof PotionEffect) {
potionEffects.add((PotionEffect) brew);
}
}
NBTTagCompound compound = new NBTTagCompound();
appendPotions(compound, mixPotions(potionEffects));
appendBrews(compound, mixBrews(brewEffects));
return compound;
}
use of net.minecraft.potion.PotionEffect in project Cavern2 by kegare.
the class EntityCavenicSpider method attackEntityAsMob.
@Override
public boolean attackEntityAsMob(Entity entity) {
if (super.attackEntityAsMob(entity)) {
if (entity instanceof EntityLivingBase) {
EntityLivingBase target = (EntityLivingBase) entity;
int sec = getBlindnessAttackPower();
if (sec > 0 && !target.isPotionActive(MobEffects.BLINDNESS)) {
target.addPotionEffect(new PotionEffect(MobEffects.BLINDNESS, sec * 20));
}
sec = getPoisonAttackPower();
if (sec > 0 && !target.isPotionActive(MobEffects.POISON)) {
target.addPotionEffect(new PotionEffect(MobEffects.POISON, sec * 20));
}
}
return true;
}
return false;
}
Aggregations