BloodMagic/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBileDemon.java

60 lines
2.5 KiB
Java
Raw Normal View History

package WayofTime.alchemicalWizardry.common.entity.mob;
import net.minecraft.entity.SharedMonsterAttributes;
2015-07-29 08:23:01 -04:00
import net.minecraft.entity.ai.EntityAIAttackOnCollide;
import net.minecraft.entity.ai.EntityAIFollowOwner;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAIOwnerHurtByTarget;
import net.minecraft.entity.ai.EntityAIOwnerHurtTarget;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.player.EntityPlayer;
2015-07-29 08:23:01 -04:00
import net.minecraft.pathfinding.PathNavigateGround;
import net.minecraft.world.World;
2015-07-29 08:23:01 -04:00
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
public class EntityBileDemon extends EntityDemon
{
public EntityBileDemon(World par1World)
{
super(par1World, AlchemicalWizardry.entityBileDemonID);
2015-07-29 08:23:01 -04:00
maxTamedHealth = 100.0F;
maxUntamedHealth = 200.0F;
this.setSize(1.3F, 2.0F);
2015-07-29 08:23:01 -04:00
((PathNavigateGround)this.getNavigator()).func_179690_a(true);
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0D, true));
this.tasks.addTask(3, this.aiSit);
2014-10-13 22:33:20 +02:00
this.tasks.addTask(4, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
this.tasks.addTask(5, new EntityAIWander(this, 1.0D));
this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
this.tasks.addTask(7, new EntityAILookIdle(this));
this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this));
this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this));
this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true));
this.setTamed(false);
attackTimer = 0;
2015-07-29 08:23:01 -04:00
this.applyEntityAttributes();
}
@Override
protected void applyEntityAttributes()
{
super.applyEntityAttributes();
//This line affects the speed of the monster
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.20000001192092896D);
//My guess is that this will alter the max health
if (this.isTamed())
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
//this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(10.0D);
}
}