本文整理汇总了Java中net.minecraft.entity.EntityLivingBase.isEntityUndead方法的典型用法代码示例。如果您正苦于以下问题:Java EntityLivingBase.isEntityUndead方法的具体用法?Java EntityLivingBase.isEntityUndead怎么用?Java EntityLivingBase.isEntityUndead使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.entity.EntityLivingBase
的用法示例。
在下文中一共展示了EntityLivingBase.isEntityUndead方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: affectEntity
import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
public void affectEntity(Entity p_180793_1_, Entity p_180793_2_, EntityLivingBase entityLivingBaseIn, int p_180793_4_, double p_180793_5_)
{
if ((this.id != heal.id || entityLivingBaseIn.isEntityUndead()) && (this.id != harm.id || !entityLivingBaseIn.isEntityUndead()))
{
if (this.id == harm.id && !entityLivingBaseIn.isEntityUndead() || this.id == heal.id && entityLivingBaseIn.isEntityUndead())
{
int j = (int)(p_180793_5_ * (double)(6 << p_180793_4_) + 0.5D);
if (p_180793_1_ == null)
{
entityLivingBaseIn.attackEntityFrom(DamageSource.magic, (float)j);
}
else
{
entityLivingBaseIn.attackEntityFrom(DamageSource.causeIndirectMagicDamage(p_180793_1_, p_180793_2_), (float)j);
}
}
}
else
{
int i = (int)(p_180793_5_ * (double)(4 << p_180793_4_) + 0.5D);
entityLivingBaseIn.heal((float)i);
}
}
示例2: affectEntity
import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
public void affectEntity(@Nullable Entity source, @Nullable Entity indirectSource, EntityLivingBase entityLivingBaseIn, int amplifier, double health)
{
if ((this != MobEffects.INSTANT_HEALTH || entityLivingBaseIn.isEntityUndead()) && (this != MobEffects.INSTANT_DAMAGE || !entityLivingBaseIn.isEntityUndead()))
{
if (this == MobEffects.INSTANT_DAMAGE && !entityLivingBaseIn.isEntityUndead() || this == MobEffects.INSTANT_HEALTH && entityLivingBaseIn.isEntityUndead())
{
int j = (int)(health * (double)(6 << amplifier) + 0.5D);
if (source == null)
{
entityLivingBaseIn.attackEntityFrom(DamageSource.magic, (float)j);
}
else
{
entityLivingBaseIn.attackEntityFrom(DamageSource.causeIndirectMagicDamage(source, indirectSource), (float)j);
}
}
}
else
{
int i = (int)(health * (double)(4 << amplifier) + 0.5D);
entityLivingBaseIn.heal((float)i);
}
}
示例3: apply
import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
@Override
public void apply(World world, BlockPos pos, EntityLivingBase entity, int amplifier, int tick) {
if (entity.isEntityUndead()) {
if (amplifier >= 3 && entity.isEntityUndead()) {
entity.setFire(500);
entity.attackEntityFrom(DamageSource.MAGIC, 20);
} else if (amplifier == 2) {
entity.attackEntityFrom(DamageSource.MAGIC, 16);
} else {
entity.attackEntityFrom(DamageSource.MAGIC, 10);
}
}
}
示例4: performEffect
import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
public void performEffect(EntityLivingBase entityLivingBaseIn, int p_76394_2_)
{
if (this.id == regeneration.id)
{
if (entityLivingBaseIn.getHealth() < entityLivingBaseIn.getMaxHealth())
{
entityLivingBaseIn.heal(1.0F);
}
}
else if (this.id == poison.id)
{
if (entityLivingBaseIn.getHealth() > 1.0F)
{
entityLivingBaseIn.attackEntityFrom(DamageSource.magic, 1.0F);
}
}
else if (this.id == wither.id)
{
entityLivingBaseIn.attackEntityFrom(DamageSource.wither, 1.0F);
}
else if (this.id == hunger.id && entityLivingBaseIn instanceof EntityPlayer)
{
((EntityPlayer)entityLivingBaseIn).addExhaustion(0.025F * (float)(p_76394_2_ + 1));
}
else if (this.id == saturation.id && entityLivingBaseIn instanceof EntityPlayer)
{
if (!entityLivingBaseIn.worldObj.isRemote)
{
((EntityPlayer)entityLivingBaseIn).getFoodStats().addStats(p_76394_2_ + 1, 1.0F);
}
}
else if ((this.id != heal.id || entityLivingBaseIn.isEntityUndead()) && (this.id != harm.id || !entityLivingBaseIn.isEntityUndead()))
{
if (this.id == harm.id && !entityLivingBaseIn.isEntityUndead() || this.id == heal.id && entityLivingBaseIn.isEntityUndead())
{
entityLivingBaseIn.attackEntityFrom(DamageSource.magic, (float)(6 << p_76394_2_));
}
}
else
{
entityLivingBaseIn.heal((float)Math.max(4 << p_76394_2_, 0));
}
}
示例5: performEffect
import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
public void performEffect(EntityLivingBase entityLivingBaseIn, int p_76394_2_)
{
if (this == MobEffects.REGENERATION)
{
if (entityLivingBaseIn.getHealth() < entityLivingBaseIn.getMaxHealth())
{
entityLivingBaseIn.heal(1.0F);
}
}
else if (this == MobEffects.POISON)
{
if (entityLivingBaseIn.getHealth() > 1.0F)
{
entityLivingBaseIn.attackEntityFrom(DamageSource.magic, 1.0F);
}
}
else if (this == MobEffects.WITHER)
{
entityLivingBaseIn.attackEntityFrom(DamageSource.wither, 1.0F);
}
else if (this == MobEffects.HUNGER && entityLivingBaseIn instanceof EntityPlayer)
{
((EntityPlayer)entityLivingBaseIn).addExhaustion(0.005F * (float)(p_76394_2_ + 1));
}
else if (this == MobEffects.SATURATION && entityLivingBaseIn instanceof EntityPlayer)
{
if (!entityLivingBaseIn.world.isRemote)
{
((EntityPlayer)entityLivingBaseIn).getFoodStats().addStats(p_76394_2_ + 1, 1.0F);
}
}
else if ((this != MobEffects.INSTANT_HEALTH || entityLivingBaseIn.isEntityUndead()) && (this != MobEffects.INSTANT_DAMAGE || !entityLivingBaseIn.isEntityUndead()))
{
if (this == MobEffects.INSTANT_DAMAGE && !entityLivingBaseIn.isEntityUndead() || this == MobEffects.INSTANT_HEALTH && entityLivingBaseIn.isEntityUndead())
{
entityLivingBaseIn.attackEntityFrom(DamageSource.magic, (float)(6 << p_76394_2_));
}
}
else
{
entityLivingBaseIn.heal((float)Math.max(4 << p_76394_2_, 0));
}
}
示例6: performEffect
import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
public void performEffect(EntityLivingBase entityLivingBaseIn, int p_76394_2_)
{
if (this == MobEffects.REGENERATION)
{
if (entityLivingBaseIn.getHealth() < entityLivingBaseIn.getMaxHealth())
{
entityLivingBaseIn.heal(1.0F);
}
}
else if (this == MobEffects.POISON)
{
if (entityLivingBaseIn.getHealth() > 1.0F)
{
entityLivingBaseIn.attackEntityFrom(DamageSource.magic, 1.0F);
}
}
else if (this == MobEffects.WITHER)
{
entityLivingBaseIn.attackEntityFrom(DamageSource.wither, 1.0F);
}
else if (this == MobEffects.HUNGER && entityLivingBaseIn instanceof EntityPlayer)
{
((EntityPlayer)entityLivingBaseIn).addExhaustion(0.025F * (float)(p_76394_2_ + 1));
}
else if (this == MobEffects.SATURATION && entityLivingBaseIn instanceof EntityPlayer)
{
if (!entityLivingBaseIn.worldObj.isRemote)
{
((EntityPlayer)entityLivingBaseIn).getFoodStats().addStats(p_76394_2_ + 1, 1.0F);
}
}
else if ((this != MobEffects.INSTANT_HEALTH || entityLivingBaseIn.isEntityUndead()) && (this != MobEffects.INSTANT_DAMAGE || !entityLivingBaseIn.isEntityUndead()))
{
if (this == MobEffects.INSTANT_DAMAGE && !entityLivingBaseIn.isEntityUndead() || this == MobEffects.INSTANT_HEALTH && entityLivingBaseIn.isEntityUndead())
{
entityLivingBaseIn.attackEntityFrom(DamageSource.magic, (float)(6 << p_76394_2_));
}
}
else
{
entityLivingBaseIn.heal((float)Math.max(4 << p_76394_2_, 0));
}
}