BiomesOPlenty/common/biomesoplenty/entities/EntityJungleSpider.java

61 lines
1.4 KiB
Java
Raw Normal View History

package biomesoplenty.entities;
2013-05-03 13:00:44 +00:00
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
2013-05-03 13:00:44 +00:00
import net.minecraft.entity.monster.EntitySpider;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;
public class EntityJungleSpider extends EntitySpider
{
2013-05-31 10:34:02 +00:00
public EntityJungleSpider(World par1World)
{
super(par1World);
this.setSize(0.4F, 0.3F);
}
2013-05-03 13:00:44 +00:00
@Override
2013-09-13 08:17:21 +00:00
protected void applyEntityAttributes()
{
2013-09-13 08:17:21 +00:00
super.applyEntityAttributes();
//Max health
2013-09-13 08:17:21 +00:00
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(6.0D);
//Movement speed
2013-09-13 08:17:21 +00:00
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.95D);
}
2013-05-03 13:00:44 +00:00
2013-05-31 10:34:02 +00:00
@Override
public boolean attackEntityAsMob(Entity par1Entity)
{
if (super.attackEntityAsMob(par1Entity))
{
if (par1Entity instanceof EntityLivingBase)
2013-05-31 10:34:02 +00:00
{
byte var2 = 0;
2013-05-03 13:00:44 +00:00
2013-05-31 10:34:02 +00:00
if (worldObj.difficultySetting > 1)
{
if (worldObj.difficultySetting == 2)
{
var2 = 7;
}
else if (worldObj.difficultySetting == 3)
{
var2 = 15;
}
}
2013-05-03 13:00:44 +00:00
2013-05-31 10:34:02 +00:00
if (var2 > 0)
{
((EntityLivingBase)par1Entity).addPotionEffect(new PotionEffect(Potion.blindness.id, var2 * 20, 0));
2013-05-31 10:34:02 +00:00
}
}
2013-05-03 13:00:44 +00:00
2013-05-31 10:34:02 +00:00
return true;
} else
return false;
}
2013-05-03 13:00:44 +00:00
}