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