Java 类net.minecraft.entity.EnumCreatureAttribute 实例源码

项目:Bewitchment    文件:BlockSaltBarrier.java   
@SuppressWarnings("deprecation")
@Override
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn, boolean p_185477_7_) {
    if (entityIn instanceof EntityLivingBase && (((EntityLivingBase) entityIn).getCreatureAttribute() == EnumCreatureAttribute.UNDEAD)) {
        collidingBoxes.add(new AxisAlignedBB(pos).expand(0, 255, 0));
    }
    if (entityIn instanceof EntityLivingBase && (((EntityLivingBase) entityIn).getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD)) {
        entityIn.attackEntityFrom(DamageSource.MAGIC, 1);
    }
    if (entityIn instanceof EntityBlaze) {
        collidingBoxes.add(new AxisAlignedBB(pos).expand(0, 255, 0));
    }
    if (entityIn instanceof EntityEnderman) {
        collidingBoxes.add(new AxisAlignedBB(pos).expand(0, 255, 0));
    }
    if (entityIn instanceof EntityGhast) {
        collidingBoxes.add(new AxisAlignedBB(pos).expand(0, 255, 0));
    }
    if (entityIn instanceof EntityVex) {
        collidingBoxes.add(new AxisAlignedBB(pos).expand(0, 255, 0));
    }
}
项目:Bewitchment    文件:OutcastsShameBrew.java   
@Override
public void apply(World world, BlockPos pos, EntityLivingBase entity, int amplifier, int tick) {
    if (amplifier >= 3) {
        if (entity instanceof EntityWitch) {
            entity.setFire(500);
            entity.attackEntityFrom(DamageSource.MAGIC, 20);
        } else if (entity.getCreatureAttribute() == EnumCreatureAttribute.ILLAGER) {
            entity.addPotionEffect(new PotionEffect(MobEffects.WITHER, 1500, 0));
            entity.attackEntityFrom(DamageSource.MAGIC, 20);
        }
    } else if (amplifier == 2 && entity.getCreatureAttribute() == EnumCreatureAttribute.ILLAGER || entity instanceof EntityWitch) {
        entity.attackEntityFrom(DamageSource.MAGIC, 16);
    } else if (entity.getCreatureAttribute() == EnumCreatureAttribute.ILLAGER) {
        entity.attackEntityFrom(DamageSource.MAGIC, 10);
    }
}
项目:Minestrappolation-4    文件:BlockGodstone.java   
@Override
public void updateTick(World world, BlockPos pos, IBlockState state, Random rand)
{
    if (!world.isRemote)
    {
        world.scheduleUpdate(pos, this, 5);
        AxisAlignedBB axisalignedbb = this.getCollisionBoundingBox(world, pos, state).expand(6, 6, 6);
        List<EntityMob> list = world.getEntitiesWithinAABB(EntityMob.class, axisalignedbb);
        for (EntityMob mob : list)
        {
            if (mob.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD)
            {
                mob.setFire(20);
            }
        }
    }
}
项目:ModularArmour    文件:UpgradeUndead.java   
@Override
public boolean shouldDefend(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, ArmourSlot slot) {

    Entity entity = source.getSourceOfDamage();

    if (entity == null) {
        return false;
    }

    if (!(entity instanceof EntityMob)) {
        return false;
    }

    EntityMob entityMob = (EntityMob) entity;

    return entityMob.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD;
}
项目:ModularArmour    文件:UpgradeArthropod.java   
@Override
public boolean shouldDefend(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, ArmourSlot slot) {
    Entity entity = source.getSourceOfDamage();

    if (entity == null) {
        return false;
    }

    if (!(entity instanceof EntityMob)) {
        return false;
    }

    EntityMob entityMob = (EntityMob) entity;

    return entityMob.getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD;
}
项目:MineFantasy    文件:ItemArmourMFOld.java   
public static boolean shouldSilverHurt(EntityLivingBase target) 
{
    Class enClass = target.getClass();
    String name = "";
    if(enClass != null && EntityList.classToStringMapping.get(enClass) != null)
    {
        name = (String) EntityList.classToStringMapping.get(enClass);
    }

    if (target.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD) 
    {
        return true;
    }
    if (name.endsWith("Werewolf")) 
    {
        return true;
    }

    return false;
}
项目:MineFantasy    文件:ItemHoundArmourMF.java   
@Override
public boolean shouldDamage(DamageSource source) 
{
    if(material == EnumArmourMF.GUILDED)
    {
        if(source.getSourceOfDamage() != null && source.getSourceOfDamage() instanceof EntityLivingBase)
        {
            if(((EntityLivingBase)source.getSourceOfDamage()).getCreatureAttribute() == EnumCreatureAttribute.UNDEAD)
            {
                return false;
            }
        }
    }
    if(material == EnumArmourMF.DRAGONFORGE)
    {
        if(source.isFireDamage())
        {
            return false;
        }
    }
    return true;
}
项目:MineFantasy    文件:ItemArmourMF.java   
public static boolean shouldSilverHurt(EntityLivingBase target) 
{
    Class enClass = target.getClass();
    String name = "";
    if(enClass != null && EntityList.classToStringMapping.get(enClass) != null)
    {
        name = (String) EntityList.classToStringMapping.get(enClass);
    }

    if (target.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD) 
    {
        return true;
    }
    if (name.endsWith("Werewolf")) 
    {
        return true;
    }

    return false;
}
项目:MineFantasy    文件:ItemHoundWeaponMF.java   
@Override
public boolean hitEntity(ItemStack weapon, EntityLiving target, EntityLiving user)
   {
    if(this.toolMaterial == ToolMaterialMedieval.DRAGONFORGE)
        target.setFire(20);

    if(this.toolMaterial == ToolMaterialMedieval.IGNOTUMITE)
    {
        user.heal(2);
    }
    if(this.toolMaterial == ToolMaterialMedieval.ORNATE)
    {
        if (((EntityLiving) target).getCreatureAttribute() == EnumCreatureAttribute.UNDEAD || target.getClass().getName().endsWith("MoCEntityWarewolf"))
        {
            target.setFire(20);
            target.worldObj.playSoundAtEntity(target, "random.fizz", 1, 1);
        }
    }

       return super.hitEntity(weapon, target, user);
   }
项目:MineFantasy    文件:ItemHoundWeaponMF.java   
@Override
public float getDamage(Entity tar)
   {
    float dam = weaponDamage;

    if(tar != null && tar instanceof EntityLiving && toolMaterial == ToolMaterialMedieval.ORNATE)
    {
        if (((EntityLiving) tar).getCreatureAttribute() == EnumCreatureAttribute.UNDEAD || tar.getClass().getName().endsWith("MoCEntityWarewolf"))
        {
            if(tar.getClass().getName().endsWith("MoCEntityWarewolf"))
            {
                dam *= 10;
            }
            else
            {
                dam *= 2;
            }
        }
    }

       return dam;
   }
项目:MineFantasy    文件:TacticalManager.java   
public static int getHearing(Entity entity)
{
    if(entity instanceof ISpecialSenses)
    {
        return((ISpecialSenses)entity).getSight();
    }
    if(entity instanceof EntityMob)
    {
        if(((EntityMob)entity).getCreatureAttribute() == EnumCreatureAttribute.UNDEAD)
        {
            return 10;
        }
    }

    return 5;
}
项目:IceAndShadow2    文件:NyxItemExousium.java   
@Override
public void onUpdate(ItemStack is, World w, Entity ent, int time, boolean holding) {
    if (ent instanceof EntityLivingBase) {
        final EntityLivingBase el = (EntityLivingBase) ent;
        if (el.getEquipmentInSlot(0) == null)
            return;
        if (el.getEquipmentInSlot(0).getItem() != this)
            return;
        else if (el.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD)
            return;
        else if (!el.isPotionActive(Potion.wither.id)) {
            el.addPotionEffect(new PotionEffect(Potion.wither.id, 41, 0));
        }
    }
    super.onUpdate(is, w, ent, time, holding);
}
项目:IceAndShadow2    文件:EntityNyxSkeleton.java   
public void doShadowAttack(EntityLivingBase par1EntityLiving, float par2) {
    final boolean harm_undead = par1EntityLiving.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD;
    final EntityThrowable entityball = new EntityShadowBall(worldObj, this, harm_undead,
            IaSWorldHelper.getRegionLevel(par1EntityLiving) >= 6);

    final double d0 = par1EntityLiving.posX + par1EntityLiving.motionX - posX;
    final double d1 = par1EntityLiving.posY + par1EntityLiving.getEyeHeight() - getEyeHeight() - posY;
    final double d2 = par1EntityLiving.posZ + par1EntityLiving.motionZ - posZ;
    final float f1 = MathHelper.sqrt_double(d0 * d0 + d2 * d2);

    if (f1 <= 2.0) {
        entityball.setThrowableHeading(d0, d1, d2, 0.40F, 8.0F);
    } else {
        entityball.rotationPitch += 20.0F;
    }
    entityball.setThrowableHeading(d0, d1 + f1 * 0.2F, d2, 0.80F, 8.0F);
    worldObj.spawnEntityInWorld(entityball);
}
项目:Bewitchment    文件:ItemSilverAxe.java   
@Override
public boolean hitEntity(ItemStack stack, EntityLivingBase target, @Nonnull EntityLivingBase attacker) {
    if (!target.world.isRemote) {
        if (target.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD && attacker instanceof EntityPlayer) {
            target.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12);
            stack.damageItem(25, attacker);
        } else {
            stack.damageItem(1, attacker);
        }
    }

    return true;
}
项目:Bewitchment    文件:ItemSilverHoe.java   
@Override
public boolean hitEntity(ItemStack stack, EntityLivingBase target, @Nonnull EntityLivingBase attacker) {
    if (!target.world.isRemote) {
        if (target.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD && attacker instanceof EntityPlayer) {
            target.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12);
            stack.damageItem(25, attacker);
        } else {
            stack.damageItem(1, attacker);
        }
    }

    return true;
}
项目:Bewitchment    文件:ItemSilverSpade.java   
@Override
public boolean hitEntity(ItemStack stack, EntityLivingBase target, @Nonnull EntityLivingBase attacker) {
    if (!target.world.isRemote) {
        if (target.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD && attacker instanceof EntityPlayer) {
            target.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12);
            stack.damageItem(25, attacker);
        } else {
            stack.damageItem(1, attacker);
        }
    }

    return true;
}
项目:Bewitchment    文件:ItemSilverPickaxe.java   
@Override
public boolean hitEntity(ItemStack stack, EntityLivingBase target, @Nonnull EntityLivingBase attacker) {
    if (!target.world.isRemote) {
        if (target.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD && attacker instanceof EntityPlayer) {
            target.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12);
            stack.damageItem(25, attacker);
        } else {
            stack.damageItem(1, attacker);
        }
    }

    return true;
}
项目:Bewitchment    文件:ItemSilverSword.java   
@Override
public boolean hitEntity(ItemStack stack, EntityLivingBase target, @Nonnull EntityLivingBase attacker) {
    if (!target.world.isRemote) {
        if (target.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD && attacker instanceof EntityPlayer) {
            target.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12);
            stack.damageItem(25, attacker);
        } else {
            stack.damageItem(1, attacker);
        }
    }

    return true;
}
项目:Bewitchment    文件:ItemSilverArmor.java   
@SubscribeEvent
public void onEntityDamage(LivingHurtEvent event) {
    DamageSource source = event.getSource();

    Entity attacker = source.getTrueSource();
    if ((attacker instanceof EntityLivingBase) && ((EntityLivingBase) attacker).getCreatureAttribute() == EnumCreatureAttribute.UNDEAD) {
        event.setAmount(event.getAmount() * 0.95F);
    }
}
项目:Bewitchment    文件:BlockRagingGrass.java   
@SuppressWarnings("deprecation")
@Override
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn, boolean p_185477_7_) {
    if (entityIn instanceof EntityLivingBase && (((EntityLivingBase) entityIn).getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD)) {
        entityIn.attackEntityFrom(DamageSource.MAGIC, 4);
    }
    if (entityIn instanceof EntityLivingBase && (((EntityLivingBase) entityIn).getCreatureAttribute() == EnumCreatureAttribute.UNDEAD)) {
        entityIn.attackEntityFrom(DamageSource.MAGIC, 4);
    }
}
项目:Bewitchment    文件:BaneArthropodsBrew.java   
@Override
public void apply(World world, BlockPos pos, EntityLivingBase entity, int amplifier, int tick) {
    if (entity.getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD) {
        if (amplifier >= 3) {
            entity.attackEntityFrom(DamageSource.MAGIC, 20);
        } else if (amplifier == 2) {
            entity.attackEntityFrom(DamageSource.MAGIC, 16);
        } else {
            entity.attackEntityFrom(DamageSource.MAGIC, 10);
        }
    }
}
项目:DecompiledMinecraft    文件:EnchantmentHelper.java   
public static float func_152377_a(ItemStack p_152377_0_, EnumCreatureAttribute p_152377_1_)
{
    enchantmentModifierLiving.livingModifier = 0.0F;
    enchantmentModifierLiving.entityLiving = p_152377_1_;
    applyEnchantmentModifier(enchantmentModifierLiving, p_152377_0_);
    return enchantmentModifierLiving.livingModifier;
}
项目:DecompiledMinecraft    文件:EnchantmentDamage.java   
/**
 * Called whenever a mob is damaged with an item that has this enchantment on it.
 */
public void onEntityDamaged(EntityLivingBase user, Entity target, int level)
{
    if (target instanceof EntityLivingBase)
    {
        EntityLivingBase entitylivingbase = (EntityLivingBase)target;

        if (this.damageType == 2 && entitylivingbase.getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD)
        {
            int i = 20 + user.getRNG().nextInt(10 * level);
            entitylivingbase.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, i, 3));
        }
    }
}
项目:DecompiledMinecraft    文件:EnchantmentHelper.java   
public static float func_152377_a(ItemStack p_152377_0_, EnumCreatureAttribute p_152377_1_)
{
    enchantmentModifierLiving.livingModifier = 0.0F;
    enchantmentModifierLiving.entityLiving = p_152377_1_;
    applyEnchantmentModifier(enchantmentModifierLiving, p_152377_0_);
    return enchantmentModifierLiving.livingModifier;
}
项目:DecompiledMinecraft    文件:EnchantmentDamage.java   
/**
 * Called whenever a mob is damaged with an item that has this enchantment on it.
 */
public void onEntityDamaged(EntityLivingBase user, Entity target, int level)
{
    if (target instanceof EntityLivingBase)
    {
        EntityLivingBase entitylivingbase = (EntityLivingBase)target;

        if (this.damageType == 2 && entitylivingbase.getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD)
        {
            int i = 20 + user.getRNG().nextInt(10 * level);
            entitylivingbase.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, i, 3));
        }
    }
}
项目:BaseClient    文件:EnchantmentHelper.java   
public static float func_152377_a(ItemStack p_152377_0_, EnumCreatureAttribute p_152377_1_)
{
    enchantmentModifierLiving.livingModifier = 0.0F;
    enchantmentModifierLiving.entityLiving = p_152377_1_;
    applyEnchantmentModifier(enchantmentModifierLiving, p_152377_0_);
    return enchantmentModifierLiving.livingModifier;
}
项目:BaseClient    文件:EnchantmentDamage.java   
/**
 * Called whenever a mob is damaged with an item that has this enchantment on it.
 */
public void onEntityDamaged(EntityLivingBase user, Entity target, int level)
{
    if (target instanceof EntityLivingBase)
    {
        EntityLivingBase entitylivingbase = (EntityLivingBase)target;

        if (this.damageType == 2 && entitylivingbase.getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD)
        {
            int i = 20 + user.getRNG().nextInt(10 * level);
            entitylivingbase.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, i, 3));
        }
    }
}
项目:BaseClient    文件:EnchantmentHelper.java   
public static float func_152377_a(ItemStack p_152377_0_, EnumCreatureAttribute p_152377_1_)
{
    enchantmentModifierLiving.livingModifier = 0.0F;
    enchantmentModifierLiving.entityLiving = p_152377_1_;
    applyEnchantmentModifier(enchantmentModifierLiving, p_152377_0_);
    return enchantmentModifierLiving.livingModifier;
}
项目:BaseClient    文件:EnchantmentDamage.java   
/**
 * Called whenever a mob is damaged with an item that has this enchantment on it.
 */
public void onEntityDamaged(EntityLivingBase user, Entity target, int level)
{
    if (target instanceof EntityLivingBase)
    {
        EntityLivingBase entitylivingbase = (EntityLivingBase)target;

        if (this.damageType == 2 && entitylivingbase.getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD)
        {
            int i = 20 + user.getRNG().nextInt(10 * level);
            entitylivingbase.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, i, 3));
        }
    }
}
项目:UniversalRemote    文件:EntityPlayerMPProxy.java   
@Override
public EnumCreatureAttribute getCreatureAttribute() {
    if (m_realPlayer == null) {
        return super.getCreatureAttribute();
    } else {
        syncToRealPlayer();
        return syncPublicFieldsFromRealAndReturn(m_realPlayer.getCreatureAttribute());
    }
}
项目:UniversalRemote    文件:EntityPlayerProxy.java   
@Override
public EnumCreatureAttribute getCreatureAttribute() {
    if (m_realPlayer == null) {
        return super.getCreatureAttribute();
    } else {
        return m_realPlayer.getCreatureAttribute();
    }
}
项目:Backmemed    文件:EnchantmentHelper.java   
public static float getModifierForCreature(ItemStack stack, EnumCreatureAttribute creatureAttribute)
{
    ENCHANTMENT_MODIFIER_LIVING.livingModifier = 0.0F;
    ENCHANTMENT_MODIFIER_LIVING.entityLiving = creatureAttribute;
    applyEnchantmentModifier(ENCHANTMENT_MODIFIER_LIVING, stack);
    return ENCHANTMENT_MODIFIER_LIVING.livingModifier;
}
项目:Backmemed    文件:EnchantmentDamage.java   
/**
 * Called whenever a mob is damaged with an item that has this enchantment on it.
 */
public void onEntityDamaged(EntityLivingBase user, Entity target, int level)
{
    if (target instanceof EntityLivingBase)
    {
        EntityLivingBase entitylivingbase = (EntityLivingBase)target;

        if (this.damageType == 2 && entitylivingbase.getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD)
        {
            int i = 20 + user.getRNG().nextInt(10 * level);
            entitylivingbase.addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, i, 3));
        }
    }
}
项目:CustomWorldGen    文件:EnchantmentHelper.java   
public static float getModifierForCreature(ItemStack stack, EnumCreatureAttribute creatureAttribute)
{
    ENCHANTMENT_MODIFIER_LIVING.livingModifier = 0.0F;
    ENCHANTMENT_MODIFIER_LIVING.entityLiving = creatureAttribute;
    applyEnchantmentModifier(ENCHANTMENT_MODIFIER_LIVING, stack);
    return ENCHANTMENT_MODIFIER_LIVING.livingModifier;
}
项目:CustomWorldGen    文件:EnchantmentDamage.java   
/**
 * Called whenever a mob is damaged with an item that has this enchantment on it.
 */
public void onEntityDamaged(EntityLivingBase user, Entity target, int level)
{
    if (target instanceof EntityLivingBase)
    {
        EntityLivingBase entitylivingbase = (EntityLivingBase)target;

        if (this.damageType == 2 && entitylivingbase.getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD)
        {
            int i = 20 + user.getRNG().nextInt(10 * level);
            entitylivingbase.addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, i, 3));
        }
    }
}
项目:CrystalMod    文件:TileEntityEngineVampire.java   
@Override
public void refuel() {
    BlockPos min = getPos();
    BlockPos max = getPos().up();
    List<EntityLivingBase> entites = getWorld().getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(min, max).expand(2, 1, 2));
    int mobsAttacked = 0;
    int fuelAmt = 0;
    if(!entites.isEmpty()){
        for(EntityLivingBase entity : entites){
            if(entity.isEntityAlive() && !(entity instanceof EntityPlayer)){
                if(entity.attackEntityFrom(DamageSource.WITHER, 1)){

                    //One pig is worth 1/4 of a piece of coal in a furnace generator. At 40 ticks * 30 CU per tick

                    int value = 1;

                    if(entity.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD){
                        value = 2;
                    }

                    fuelAmt+=80*value;

                    mobsAttacked++;
                    if(mobsAttacked >= Config.engine_vampire_maxattack){
                        break;
                    }
                }
            }
        }
    }
    if(fuelAmt > 0){
        fuel.add(fuelAmt);
        maxFuel.setValue(fuel.getValue());
    }
}
项目:MidgarCrusade    文件:ServerSpellHandler.java   
public static void handle_Cure(PacketSpellToServer message, World world)
{
    Entity e;

    e = world.getEntityByID(message.data);

    if(((EntityLivingBase) e).getCreatureAttribute()==EnumCreatureAttribute.UNDEAD){

    ((EntityLivingBase)e).attackEntityFrom(DamageSource.generic, 4.0f + (message.data2 / 20.0f));
    }
    if (e instanceof EntityLivingBase && !(e instanceof EntityMob))
    {
        ((EntityLivingBase)e).heal(3.0f + message.data2 / 30); //30 clarity pour 1 coeur en plus
    }
}
项目:MidgarCrusade    文件:ServerSpellHandler.java   
public static void handle_Cura(PacketSpellToServer message, World world)
{
    Entity e;

    e = world.getEntityByID(message.data);
    if (e instanceof EntityLivingBase && !(e instanceof EntityMob))
    {
        ((EntityLivingBase)e).heal(6.0f + message.data2 / 30); //30 clarity pour 1 coeur en plus
    }
    if(((EntityLivingBase) e).getCreatureAttribute()==EnumCreatureAttribute.UNDEAD){

        ((EntityLivingBase)e).attackEntityFrom(DamageSource.generic, 8.0f + (message.data2 / 20.0f));
    }

}
项目:MidgarCrusade    文件:ServerSpellHandler.java   
public static void handle_Curaga(PacketSpellToServer message, World world)
{
    Entity e;

    e = world.getEntityByID(message.data);
    if (e instanceof EntityLivingBase && !(e instanceof EntityMob))
    {
        ((EntityLivingBase)e).heal(9.0f + message.data2 / 30); //30 clarity pour 1 coeur en plus
    }

    if(((EntityLivingBase) e).getCreatureAttribute()==EnumCreatureAttribute.UNDEAD){

        ((EntityLivingBase)e).attackEntityFrom(DamageSource.generic, 12.0f + (message.data2 / 20.0f));
    }
}
项目:Gravestone-mod-Extended    文件:EnchantmentShadowOfDeath.java   
@Override
public float calcDamageByCreature(int level, EnumCreatureAttribute creatureType) {
    if (creatureType == EnumCreatureAttribute.ILLAGER || creatureType == EnumCreatureAttribute.UNDEFINED) {
        return level * 2.5F;
    } else {
        return 0;
    }
}