當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。