本文整理汇总了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;
}
示例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);
}
}
}
示例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));
}
}
}
示例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));
}
}
}
示例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));
}
}
}
示例6: getCreatureAttribute
/**
* Get this Entity's EnumCreatureAttribute
*/
public EnumCreatureAttribute getCreatureAttribute()
{
return EnumCreatureAttribute.ARTHROPOD;
}
示例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));
}
示例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));
}
示例9: getCreatureAttribute
@Override
public EnumCreatureAttribute getCreatureAttribute()
{
return EnumCreatureAttribute.ARTHROPOD;
}
示例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);
}
}
}
示例11: getCreatureAttribute
/**
* Get this Entity's EnumCreatureAttribute
*/
@Override
public EnumCreatureAttribute getCreatureAttribute()
{
return EnumCreatureAttribute.ARTHROPOD;
}
示例12: getCreatureAttribute
@Override
public EnumCreatureAttribute getCreatureAttribute() {
return EnumCreatureAttribute.ARTHROPOD;
}
示例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));
}
示例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;
}
示例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));
}