001 package net.minecraft.src;
002
003 import cpw.mods.fml.common.Side;
004 import cpw.mods.fml.common.asm.SideOnly;
005
006 public class EntityCaveSpider extends EntitySpider
007 {
008 public EntityCaveSpider(World par1World)
009 {
010 super(par1World);
011 this.texture = "/mob/cavespider.png";
012 this.setSize(0.7F, 0.5F);
013 }
014
015 public int getMaxHealth()
016 {
017 return 12;
018 }
019
020 @SideOnly(Side.CLIENT)
021
022 /**
023 * How large the spider should be scaled.
024 */
025 public float spiderScaleAmount()
026 {
027 return 0.7F;
028 }
029
030 public boolean attackEntityAsMob(Entity par1Entity)
031 {
032 if (super.attackEntityAsMob(par1Entity))
033 {
034 if (par1Entity instanceof EntityLiving)
035 {
036 byte var2 = 0;
037
038 if (this.worldObj.difficultySetting > 1)
039 {
040 if (this.worldObj.difficultySetting == 2)
041 {
042 var2 = 7;
043 }
044 else if (this.worldObj.difficultySetting == 3)
045 {
046 var2 = 15;
047 }
048 }
049
050 if (var2 > 0)
051 {
052 ((EntityLiving)par1Entity).addPotionEffect(new PotionEffect(Potion.poison.id, var2 * 20, 0));
053 }
054 }
055
056 return true;
057 }
058 else
059 {
060 return false;
061 }
062 }
063 }