use of net.minecraft.potion.PotionEffect in project Random-Things by lumien231.
the class ModPotions method preInit.
public static void preInit(FMLPreInitializationEvent event) {
imbueFire = new ImbueFire();
imbuePoison = new ImbuePoison();
imbueExperience = new ImbueExperience();
imbueWither = new ImbueWither();
imbueCollapse = new ImbueCollapse();
collapse = new EffectCollapse();
collapseType = new PotionType("rtcollapse", new PotionEffect(collapse, 450));
collapseTypeLong = new PotionType("rtcollapse", new PotionEffect(collapse, 900));
collapseTypeStrong = new PotionType("rtcollapse", new PotionEffect(collapse, 300, 1));
collapseType.setRegistryName(new ResourceLocation("randomthings", "collapse"));
collapseTypeLong.setRegistryName(new ResourceLocation("randomthings", "long_collapse"));
collapseTypeStrong.setRegistryName(new ResourceLocation("randomthings", "strong_collapse"));
ForgeRegistries.POTION_TYPES.register(collapseType);
ForgeRegistries.POTION_TYPES.register(collapseTypeLong);
ForgeRegistries.POTION_TYPES.register(collapseTypeStrong);
// Brewing
PotionHelper.addMix(PotionTypes.AWKWARD, Ingredient.fromStacks(new ItemStack(ModItems.ingredients, 1, 0)), collapseType);
PotionHelper.addMix(collapseType, Items.REDSTONE, collapseTypeLong);
PotionHelper.addMix(collapseType, Items.GLOWSTONE_DUST, collapseTypeStrong);
}
use of net.minecraft.potion.PotionEffect in project harvestcraft by MatrexsVigil.
the class ItemPamTopTierFood method onFoodEaten.
@Override
protected void onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.getPotionFromResourceLocation("strength"), ConfigHandler.buffTimeForTopTier, 0));
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.getPotionFromResourceLocation("resistance"), ConfigHandler.buffTimeForTopTier, 0));
}
use of net.minecraft.potion.PotionEffect in project KalStuff by TEAMModding.
the class ItemDrink method addEffects.
protected void addEffects(ItemStack stack, World worldIn, EntityPlayer player) {
if (!worldIn.isRemote && this.potionLength != 0) {
for (Potion p : this.potions) {
try {
player.addPotionEffect(new PotionEffect(p, ((this.potionLength / (this.getMaxDamage(stack) + 1)) + player.getActivePotionEffect(p).getDuration()), 0));
} catch (NullPointerException e) {
player.addPotionEffect(new PotionEffect(p, (this.potionLength / (this.getMaxDamage(stack) + 1)), 0));
}
if (player.getActivePotionEffect(p).getDuration() > 7200) {
player.removePotionEffect(p);
player.addPotionEffect(new PotionEffect(p, 7200, 0));
}
}
}
}
use of net.minecraft.potion.PotionEffect in project RFTools by McJty.
the class TeleportationTools method applyEffectForSeverity.
public static void applyEffectForSeverity(EntityPlayer player, int severity, boolean boostNeeded) {
getPotions();
switch(severity) {
case 1:
if (boostNeeded) {
player.addPotionEffect(new PotionEffect(confusion, 100));
player.addPotionEffect(new PotionEffect(harm, 5));
}
break;
case 2:
player.addPotionEffect(new PotionEffect(harm, 100));
break;
case 3:
player.addPotionEffect(new PotionEffect(harm, 100));
player.attackEntityFrom(DamageSource.GENERIC, 0.5f);
break;
case 4:
player.addPotionEffect(new PotionEffect(harm, 200));
player.attackEntityFrom(DamageSource.GENERIC, 0.5f);
break;
case 5:
player.addPotionEffect(new PotionEffect(harm, 200));
player.attackEntityFrom(DamageSource.GENERIC, 1.0f);
break;
case 6:
player.addPotionEffect(new PotionEffect(harm, 300));
player.attackEntityFrom(DamageSource.GENERIC, 1.0f);
break;
case 7:
player.addPotionEffect(new PotionEffect(harm, 300));
player.addPotionEffect(new PotionEffect(wither, 200));
player.attackEntityFrom(DamageSource.GENERIC, 2.0f);
break;
case 8:
player.addPotionEffect(new PotionEffect(harm, 400));
player.addPotionEffect(new PotionEffect(wither, 300));
player.attackEntityFrom(DamageSource.GENERIC, 2.0f);
break;
case 9:
player.addPotionEffect(new PotionEffect(harm, 400));
player.addPotionEffect(new PotionEffect(wither, 400));
player.attackEntityFrom(DamageSource.GENERIC, 3.0f);
break;
case 10:
player.addPotionEffect(new PotionEffect(harm, 500));
player.addPotionEffect(new PotionEffect(wither, 500));
player.attackEntityFrom(DamageSource.GENERIC, 3.0f);
break;
}
}
use of net.minecraft.potion.PotionEffect in project TecTech by Technus.
the class GT_MetaTileEntity_Hatch_OverflowElemental method vapePollution.
private void vapePollution(IGregTechTileEntity mte) {
float xPos = mte.getXCoord() + 0.5f;
float yPos = mte.getYCoord() + 0.5f;
float zPos = mte.getZCoord() + 0.5f;
int xDirShift = ForgeDirection.getOrientation(mte.getFrontFacing()).offsetX;
int yDirShift = ForgeDirection.getOrientation(mte.getFrontFacing()).offsetY;
int zDirShift = ForgeDirection.getOrientation(mte.getFrontFacing()).offsetZ;
AxisAlignedBB aabb = AxisAlignedBB.getBoundingBox(xPos - .5 + xDirShift, yPos - .5 + yDirShift, zPos - .5 + zDirShift, xPos + .5 + xDirShift, yPos + 1.5 + yDirShift, zPos + .5 + zDirShift);
for (Object entity : mte.getWorld().getEntitiesWithinAABB(EntityLivingBase.class, aabb)) {
float damagingFactor = (float) Math.log(overflowDisperse);
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.confusion.id, 1, (int) (damagingFactor * 20)));
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.wither.id, 2, (int) (damagingFactor * 15)));
((EntityLivingBase) entity).attackEntityFrom(elementalPollution, damagingFactor);
}
}
Aggregations