package uk.co.wehavecookies56.kk.common.entity.mobs; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.EntityAILookIdle; import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; import net.minecraft.entity.ai.EntityAINearestAttackableTarget; import net.minecraft.entity.ai.EntityAIWander; import net.minecraft.entity.ai.EntityAIWatchClosest; import net.minecraft.entity.monster.EntityMob; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; import uk.co.wehavecookies56.kk.common.core.helper.EntityHelper; import uk.co.wehavecookies56.kk.common.core.helper.EntityHelper.MobType; import uk.co.wehavecookies56.kk.common.entity.mobs.ai.EntityAIBlueRhapsody; public class EntityBlueRhapsody extends BaseEntityHeartless implements IKHMob { public EntityBlueRhapsody(World world) { super(world); this.isImmuneToFire = false; this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 1.0D)); this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); this.tasks.addTask(8, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); this.targetTasks.addTask(2, new EntityAIBlueRhapsody(this)); } public void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(35.0D); this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.22D); this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(4.0D); this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(60.0D); } protected void entityInit() { super.entityInit(); this.dataManager.register(EntityHelper.STATE, 0); this.dataManager.register(EntityHelper.ANIMATION, 0); } protected boolean isValidLightLevel() {return true;} protected boolean canDespawn() {return true;} public boolean isAIEnabled() {return true;} public boolean getCanSpawnHere() {return true;} public MobType getType() { return MobType.HEARTLESS_EMBLEM; } }