当前位置: 首页>>代码示例>>Java>>正文


Java EntityPotion.setPotionDamage方法代码示例

本文整理汇总了Java中net.minecraft.entity.projectile.EntityPotion.setPotionDamage方法的典型用法代码示例。如果您正苦于以下问题:Java EntityPotion.setPotionDamage方法的具体用法?Java EntityPotion.setPotionDamage怎么用?Java EntityPotion.setPotionDamage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.entity.projectile.EntityPotion的用法示例。


在下文中一共展示了EntityPotion.setPotionDamage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: attackEntityWithRangedAttack

import net.minecraft.entity.projectile.EntityPotion; //导入方法依赖的package包/类
/**
 * Attack the specified entity using a ranged attack.
 */
public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_)
{
    if (!this.getAggressive())
    {
        EntityPotion entitypotion = new EntityPotion(this.worldObj, this, 32732);
        double d0 = p_82196_1_.posY + (double)p_82196_1_.getEyeHeight() - 1.100000023841858D;
        entitypotion.rotationPitch -= -20.0F;
        double d1 = p_82196_1_.posX + p_82196_1_.motionX - this.posX;
        double d2 = d0 - this.posY;
        double d3 = p_82196_1_.posZ + p_82196_1_.motionZ - this.posZ;
        float f = MathHelper.sqrt_double(d1 * d1 + d3 * d3);

        if (f >= 8.0F && !p_82196_1_.isPotionActive(Potion.moveSlowdown))
        {
            entitypotion.setPotionDamage(32698);
        }
        else if (p_82196_1_.getHealth() >= 8.0F && !p_82196_1_.isPotionActive(Potion.poison))
        {
            entitypotion.setPotionDamage(32660);
        }
        else if (f <= 3.0F && !p_82196_1_.isPotionActive(Potion.weakness) && this.rand.nextFloat() < 0.25F)
        {
            entitypotion.setPotionDamage(32696);
        }

        entitypotion.setThrowableHeading(d1, d2 + (double)(f * 0.2F), d3, 0.75F, 8.0F);
        this.worldObj.spawnEntityInWorld(entitypotion);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:33,代码来源:EntityWitch.java

示例2: attackEntityWithRangedAttack

import net.minecraft.entity.projectile.EntityPotion; //导入方法依赖的package包/类
/**
 * Attack the specified entity using a ranged attack.
 */
public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2)
{
    if (!this.getAggressive())
    {
        EntityPotion var3 = new EntityPotion(this.worldObj, this, 32732);
        var3.rotationPitch -= -20.0F;
        double var4 = par1EntityLivingBase.posX + par1EntityLivingBase.motionX - this.posX;
        double var6 = par1EntityLivingBase.posY + (double)par1EntityLivingBase.getEyeHeight() - 1.100000023841858D - this.posY;
        double var8 = par1EntityLivingBase.posZ + par1EntityLivingBase.motionZ - this.posZ;
        float var10 = MathHelper.sqrt_double(var4 * var4 + var8 * var8);

        if (var10 >= 8.0F && !par1EntityLivingBase.isPotionActive(Potion.moveSlowdown))
        {
            var3.setPotionDamage(32698);
        }
        else if (par1EntityLivingBase.getHealth() >= 8.0F && !par1EntityLivingBase.isPotionActive(Potion.poison))
        {
            var3.setPotionDamage(32660);
        }
        else if (var10 <= 3.0F && !par1EntityLivingBase.isPotionActive(Potion.weakness) && this.rand.nextFloat() < 0.25F)
        {
            var3.setPotionDamage(32696);
        }

        var3.setThrowableHeading(var4, var6 + (double)(var10 * 0.2F), var8, 0.75F, 8.0F);
        this.worldObj.spawnEntityInWorld(var3);
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:32,代码来源:EntityWitch.java

示例3: attackEntityWithRangedAttack

import net.minecraft.entity.projectile.EntityPotion; //导入方法依赖的package包/类
public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_)
{
    if (!this.getAggressive())
    {
        EntityPotion entitypotion = new EntityPotion(this.worldObj, this, 32732);
        entitypotion.rotationPitch -= -20.0F;
        double d0 = p_82196_1_.posX + p_82196_1_.motionX - this.posX;
        double d1 = p_82196_1_.posY + (double)p_82196_1_.getEyeHeight() - 1.100000023841858D - this.posY;
        double d2 = p_82196_1_.posZ + p_82196_1_.motionZ - this.posZ;
        float f1 = MathHelper.sqrt_double(d0 * d0 + d2 * d2);

        if (f1 >= 8.0F && !p_82196_1_.isPotionActive(Potion.moveSlowdown))
        {
            entitypotion.setPotionDamage(32698);
        }
        else if (p_82196_1_.getHealth() >= 8.0F && !p_82196_1_.isPotionActive(Potion.poison))
        {
            entitypotion.setPotionDamage(32660);
        }
        else if (f1 <= 3.0F && !p_82196_1_.isPotionActive(Potion.weakness) && this.rand.nextFloat() < 0.25F)
        {
            entitypotion.setPotionDamage(32696);
        }

        entitypotion.setThrowableHeading(d0, d1 + (double)(f1 * 0.2F), d2, 0.75F, 8.0F);
        this.worldObj.spawnEntityInWorld(entitypotion);
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:29,代码来源:EntityWitch.java

示例4: attackEntityWithRangedAttack

import net.minecraft.entity.projectile.EntityPotion; //导入方法依赖的package包/类
/**
 * Attack the specified entity using a ranged attack.
 */
public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2)
{
    if (!this.getAggressive())
    {
        EntityPotion entitypotion = new EntityPotion(this.worldObj, this, 32732);
        entitypotion.rotationPitch -= -20.0F;
        double d0 = par1EntityLivingBase.posX + par1EntityLivingBase.motionX - this.posX;
        double d1 = par1EntityLivingBase.posY + (double)par1EntityLivingBase.getEyeHeight() - 1.100000023841858D - this.posY;
        double d2 = par1EntityLivingBase.posZ + par1EntityLivingBase.motionZ - this.posZ;
        float f1 = MathHelper.sqrt_double(d0 * d0 + d2 * d2);

        if (f1 >= 8.0F && !par1EntityLivingBase.isPotionActive(Potion.moveSlowdown))
        {
            entitypotion.setPotionDamage(32698);
        }
        else if (par1EntityLivingBase.getHealth() >= 8.0F && !par1EntityLivingBase.isPotionActive(Potion.poison))
        {
            entitypotion.setPotionDamage(32660);
        }
        else if (f1 <= 3.0F && !par1EntityLivingBase.isPotionActive(Potion.weakness) && this.rand.nextFloat() < 0.25F)
        {
            entitypotion.setPotionDamage(32696);
        }

        entitypotion.setThrowableHeading(d0, d1 + (double)(f1 * 0.2F), d2, 0.75F, 8.0F);
        this.worldObj.spawnEntityInWorld(entitypotion);
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:32,代码来源:EntityWitch.java


注:本文中的net.minecraft.entity.projectile.EntityPotion.setPotionDamage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。