Hi whenever i hit my boss i can hit him once but no more and he continuously turns red like when you hit a normal mob but stays that way
Entity
package com.camerpon900.realauto2.bosses;
import com.camerpon900.realauto2.RealAuto2;
import com.camerpon900.realauto2.entity.EntityCamerpon900Mob;
import cpw.mods.fml.common.registry.EntityRegistry;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
public class EntityRedstoneBoss extends RA2Boss {
public EntityRedstoneBoss(World world) {
super(world);
this.setSize(3F,4F);
}
@Override
protected void applyEntityAttributes(){
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(220D);
}
@Override
protected void initAI(){
this.getNavigator().setBreakDoors(true);
this.tasks.addTask(0, new EntityAIWander(this, 1D));
this.tasks.addTask(1, new EntityAISwimming(this));
this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, true));
this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true));
}
public int hitCount = 0;
@Override
public boolean attackEntityFrom(DamageSource par1DamageSource, float par2){
hitCount++;
return super.attackEntityFrom(par1DamageSource, par2);
}
}
Bosses Class
package com.camerpon900.realauto2.bosses;
import com.camerpon900.realauto2.RealAuto2;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;
public class RA2Boss extends EntityMob implements IRA2Boss {
public boolean playerCanSee = false;
public RA2Boss(World world) {
super(world);
this.stepHeight = 1.02f;
initAI();
}
@Override
public void onUpdate() {
}
public void addAI() {
}
@Override
protected boolean isAIEnabled(){
return true;
}
@Override
protected void applyEntityAttributes(){
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(48);
}
protected void initAI(){
this.getNavigator().setBreakDoors(true);
this.tasks.addTask(0, new EntityAISwimming(this));
this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true));
this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true));
}
@Override
public boolean allowLeashing(){
return false;
}
@Override
public void addPotionEffect(PotionEffect effect){
super.addPotionEffect(effect);
}
public World func_82194_d(){
return this.worldObj;
}
}
Renderer
package com.camerpon900.realauto2.bosses.render;
import com.camerpon900.realauto2.bosses.RA2Boss;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.boss.BossStatus;
import net.minecraft.util.ResourceLocation;
public abstract class RenderBoss extends RenderLiving {
public RenderBoss(ModelBase model) {
super(model,0.5F);
}
@Override
protected void renderModel(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4, float par5, float par6, float par7){
RA2Boss boss = (RA2Boss)par1EntityLivingBase;
BossStatus.setBossStatus((RA2Boss) par1EntityLivingBase, true);
super.renderModel(par1EntityLivingBase, par2, par3, par4, par5, par6, par7);
}
@Override
protected abstract ResourceLocation getEntityTexture(Entity entity);
}
EDIT: I am aware that my boss has no AI yet and i want to find this out first before he goes around killing me and i cant do any damage to him