use of net.minecraft.potion.PotionEffect in project Bewitchment by Um-Mitternacht.
the class IncantationFisheye method cast.
// Todo: Make this only affect vision.
@SuppressWarnings("ConstantConditions")
@Override
public void cast(EntityPlayer sender, String[] args) {
sender.addPotionEffect(new PotionEffect(MobEffects.WATER_BREATHING, 275, 0));
sender.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, 275, 0));
}
use of net.minecraft.potion.PotionEffect in project Bewitchment by Um-Mitternacht.
the class ItemHoney method onFoodEaten.
@Override
protected void onFoodEaten(ItemStack stack, World worldIn, EntityPlayer player) {
player.addPotionEffect(new PotionEffect(MobEffects.HASTE, 450, 0));
player.addPotionEffect(new PotionEffect(MobEffects.LUCK, 450, 0));
}
use of net.minecraft.potion.PotionEffect in project Bewitchment by Um-Mitternacht.
the class ItemTriskelionAmulet method onWornTick.
@Override
public void onWornTick(ItemStack itemstack, EntityLivingBase player) {
if (itemstack.getItemDamage() == 0 && player.ticksExisted % 40 == 0) {
player.addPotionEffect(new PotionEffect(MobEffects.STRENGTH, 120, 0, true, true));
player.addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, 120, 0, true, true));
}
}
use of net.minecraft.potion.PotionEffect in project Bewitchment by Um-Mitternacht.
the class FortuneMeetUberSilverfish method apply.
@Override
public boolean apply(EntityPlayer player) {
for (int i = 0; i < 10; i++) {
BlockPos pos = new BlockPos(player.posX + player.getRNG().nextGaussian() * 4, player.posY, player.posZ + player.getRNG().nextGaussian() * 4);
EntitySilverfish silverfish = new EntitySilverfish(player.world);
if (player.world.isAirBlock(pos) && player.world.isAirBlock(pos.up()) && player.world.getBlockState(pos.down()).canEntitySpawn(silverfish)) {
silverfish.setPosition(pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5);
silverfish.onInitialSpawn(player.world.getDifficultyForLocation(pos), null);
player.world.spawnEntity(silverfish);
if (player.getRNG().nextInt(10) < player.world.getDifficulty().ordinal())
silverfish.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 900, 1));
if (player.getRNG().nextInt(10) < player.world.getDifficulty().ordinal())
silverfish.addPotionEffect(new PotionEffect(MobEffects.STRENGTH, 900, 1));
if (player.getRNG().nextInt(10) < player.world.getDifficulty().ordinal())
silverfish.addPotionEffect(new PotionEffect(MobEffects.SPEED, 900, 1));
if (player.getRNG().nextInt(10) < player.world.getDifficulty().ordinal())
silverfish.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 900, 1));
return true;
}
}
return false;
}
use of net.minecraft.potion.PotionEffect in project Bewitchment by Um-Mitternacht.
the class BrewSimpleModifier method apply.
@Override
public boolean apply(List<Object> brews, Object current) {
if (current instanceof PotionEffect) {
PotionEffect effect = (PotionEffect) current;
if (effect.getDuration() < 9600) {
int hue = MathHelper.clamp(effect.getDuration() + duration, 0, 9600);
effect.combine(new PotionEffect(effect.getPotion(), hue, effect.getAmplifier()));
}
if (effect.getAmplifier() < 3) {
int hue = MathHelper.clamp(effect.getAmplifier() + amplifier, 0, 3);
effect.combine(new PotionEffect(effect.getPotion(), effect.getDuration(), hue));
}
} else if (current instanceof BrewEffect) {
BrewEffect effect = (BrewEffect) current;
if (effect.getDuration() < 9600) {
int hue = MathHelper.clamp(effect.getDuration() + duration, 0, 9600);
effect.setDuration(hue);
}
if (effect.getAmplifier() < 3) {
int hue = MathHelper.clamp(effect.getAmplifier() + amplifier, 0, 3);
effect.setAmplifier(hue);
}
}
return true;
}
Aggregations