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


Java EnumCreatureAttribute.ARTHROPOD属性代码示例

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


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

示例1: shouldDefend

@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;
}
 
开发者ID:chbachman,项目名称:ModularArmour,代码行数:16,代码来源:UpgradeArthropod.java

示例2: apply

@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);
		}
	}
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:12,代码来源:BaneArthropodsBrew.java

示例3: onEntityDamaged

/**
 * 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));
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:16,代码来源:EnchantmentDamage.java

示例4: func_151368_a

public void func_151368_a(EntityLivingBase p_151368_1_, Entity p_151368_2_, int p_151368_3_)
{
    if (p_151368_2_ instanceof EntityLivingBase)
    {
        EntityLivingBase var4 = (EntityLivingBase)p_151368_2_;

        if (this.damageType == 2 && var4.getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD)
        {
            int var5 = 20 + p_151368_1_.getRNG().nextInt(10 * p_151368_3_);
            var4.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, var5, 3));
        }
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:13,代码来源:EnchantmentDamage.java

示例5: func_151368_a

public void func_151368_a(EntityLivingBase p_151368_1_, Entity p_151368_2_, int p_151368_3_)
{
    if (p_151368_2_ instanceof EntityLivingBase)
    {
        EntityLivingBase entitylivingbase1 = (EntityLivingBase)p_151368_2_;

        if (this.damageType == 2 && entitylivingbase1.getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD)
        {
            int j = 20 + p_151368_1_.getRNG().nextInt(10 * p_151368_3_);
            entitylivingbase1.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, j, 3));
        }
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:13,代码来源:EnchantmentDamage.java

示例6: getCreatureAttribute

/**
 * Get this Entity's EnumCreatureAttribute
 */
public EnumCreatureAttribute getCreatureAttribute()
{
    return EnumCreatureAttribute.ARTHROPOD;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:7,代码来源:EntitySpider.java

示例7: calcDamageByCreature

/**
 * Calculates the additional damage that will be dealt by an item with this enchantment. This alternative to
 * calcModifierDamage is sensitive to the targets EnumCreatureAttribute.
 */
public float calcDamageByCreature(int level, EnumCreatureAttribute creatureType)
{
    return this.damageType == 0 ? (float)level * 1.25F : (this.damageType == 1 && creatureType == EnumCreatureAttribute.UNDEAD ? (float)level * 2.5F : (this.damageType == 2 && creatureType == EnumCreatureAttribute.ARTHROPOD ? (float)level * 2.5F : 0.0F));
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:8,代码来源:EnchantmentDamage.java

示例8: calcDamageByCreature

/**
 * Calculates the additional damage that will be dealt by an item with this enchantment. This alternative to
 * calcModifierDamage is sensitive to the targets EnumCreatureAttribute.
 */
public float calcDamageByCreature(int level, EnumCreatureAttribute creatureType)
{
    return this.damageType == 0 ? 1.0F + (float)Math.max(0, level - 1) * 0.5F : (this.damageType == 1 && creatureType == EnumCreatureAttribute.UNDEAD ? (float)level * 2.5F : (this.damageType == 2 && creatureType == EnumCreatureAttribute.ARTHROPOD ? (float)level * 2.5F : 0.0F));
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:8,代码来源:EnchantmentDamage.java

示例9: getCreatureAttribute

@Override
public EnumCreatureAttribute getCreatureAttribute()
{
    return EnumCreatureAttribute.ARTHROPOD;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:5,代码来源:EntitySludgeling.java

示例10: passesFilter

public boolean passesFilter(Entity entity){
	if(filter == null || filter == FilterType.NONE) return false;
	switch(filter){
		default : case ALL : {
			return true; 
		}
		case PLAYER : {
			return entity instanceof EntityPlayer; 
		}
		case UNDEAD : {
			return (entity instanceof EntityLivingBase && ((EntityLivingBase)entity).getCreatureAttribute() == EnumCreatureAttribute.UNDEAD);
		}
		case ARTHROPOD : {
			return (entity instanceof EntityLivingBase && ((EntityLivingBase)entity).getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD);
		}
		case MONSTER : {
			return (entity instanceof IMob);
		}
		case ANIMAL : {
			return (entity instanceof EntityAnimal);
		}
		case LIVING : {
			return (entity instanceof EntityLiving);
		}
		case WATER : {
			return (entity instanceof EntityWaterMob || entity instanceof EntityGuardian);
		}
		case BABY : {
			return (entity instanceof EntityLivingBase && ((EntityLivingBase)entity).isChild());
		}
		case PET : {
			return (entity instanceof IEntityOwnable);
		}
		case SLIME : {
			return (entity instanceof EntitySlime);
		}
		case VILLAGER : {
			return (entity instanceof EntityVillager);
		}
		case ITEM : {
			return (entity instanceof EntityItem);
		}
	}
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:44,代码来源:TileEntityEntityHopper.java

示例11: getCreatureAttribute

/**
 * Get this Entity's EnumCreatureAttribute
 */
@Override
public EnumCreatureAttribute getCreatureAttribute()
{
    return EnumCreatureAttribute.ARTHROPOD;
}
 
开发者ID:katzenpapst,项目名称:amunra,代码行数:8,代码来源:EntityAlienBug.java

示例12: getCreatureAttribute

@Override
public EnumCreatureAttribute getCreatureAttribute() {
	return EnumCreatureAttribute.ARTHROPOD;
}
 
开发者ID:ganymedes01,项目名称:Et-Futurum,代码行数:4,代码来源:EntityEndermite.java

示例13: calcModifierLiving

/**
 * Calculates de (magic) damage done by the enchantment on a living entity based on level and entity passed.
 */
public float calcModifierLiving(int par1, EntityLivingBase par2EntityLivingBase)
{
    return this.damageType == 0 ? (float)par1 * 1.25F : (this.damageType == 1 && par2EntityLivingBase.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD ? (float)par1 * 2.5F : (this.damageType == 2 && par2EntityLivingBase.getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD ? (float)par1 * 2.5F : 0.0F));
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:7,代码来源:EnchantmentDamage.java

示例14: modifyDamLiving

private float modifyDamLiving(ItemStack weapon, EntityLivingBase target, float dam)
{
	float sharp = EnchantmentHelper.getEnchantmentLevel(Enchantment.sharpness.effectId, weapon);
	float spider = EnchantmentHelper.getEnchantmentLevel(Enchantment.baneOfArthropods.effectId, weapon);
	float smite = EnchantmentHelper.getEnchantmentLevel(Enchantment.smite.effectId, weapon);
	
	if(!worldObj.isRemote)
	{
		System.out.println("Start " + dam);
	}
	
	if(sharp > 0)
	{
		dam += sharp * 1.25F;
		
		if(!worldObj.isRemote)
		{
			System.out.println("Sharpness " + (sharp * 1.25F));
		}
	}
	if(spider > 0 && target.getCreatureAttribute()==EnumCreatureAttribute.ARTHROPOD)
	{
		dam += spider * 2.5F;
		
		if(!worldObj.isRemote)
		{
			System.out.println("Bane " + (spider * 2.5F));
		}
	}
	if(smite > 0 && target.getCreatureAttribute()==EnumCreatureAttribute.UNDEAD)
	{
		dam += (smite * 2.5F);
		
		if(!worldObj.isRemote)
		{
			System.out.println("Smite " + (smite * 2.5F));
		}
	}
	
	if(!worldObj.isRemote)
	{
		System.out.println("End " + dam);
	}
	
	return dam;
}
 
开发者ID:TheAwesomeGem,项目名称:MineFantasy,代码行数:46,代码来源:EntityThrownSpear.java

示例15: func_152376_a

public float func_152376_a(int p_152376_1_, EnumCreatureAttribute p_152376_2_)
{
    return this.damageType == 0 ? (float)p_152376_1_ * 1.25F : (this.damageType == 1 && p_152376_2_ == EnumCreatureAttribute.UNDEAD ? (float)p_152376_1_ * 2.5F : (this.damageType == 2 && p_152376_2_ == EnumCreatureAttribute.ARTHROPOD ? (float)p_152376_1_ * 2.5F : 0.0F));
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:4,代码来源:EnchantmentDamage.java


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