I also lowered the y level to 55, here is the full class:
package com.Egietje.KokkieMod.mobs.grot;
import java.util.UUID;
import javax.annotation.Nullable;
import com.Egietje.KokkieMod.init.KokkieSounds;
import com.Egietje.KokkieMod.mobs.KokkieLoot;
import com.google.common.base.Predicate;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityAgeable;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIAttackMelee;
import net.minecraft.entity.ai.EntityAIBeg;
import net.minecraft.entity.ai.EntityAIFollowOwner;
import net.minecraft.entity.ai.EntityAIFollowParent;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
import net.minecraft.entity.ai.EntityAILeapAtTarget;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAIMate;
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
import net.minecraft.entity.ai.EntityAIOwnerHurtByTarget;
import net.minecraft.entity.ai.EntityAIOwnerHurtTarget;
import net.minecraft.entity.ai.EntityAIPanic;
import net.minecraft.entity.ai.EntityAISit;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAITargetNonTamed;
import net.minecraft.entity.ai.EntityAITempt;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.monster.EntityGhast;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.passive.EntityChicken;
import net.minecraft.entity.passive.EntityHorse;
import net.minecraft.entity.passive.EntityRabbit;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.entity.passive.EntityTameable;
import net.minecraft.entity.passive.EntityWolf;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.init.Items;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.datasync.DataParameter;
import net.minecraft.network.datasync.DataSerializers;
import net.minecraft.network.datasync.EntityDataManager;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumHand;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import net.minecraft.util.datafix.DataFixer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.EnumDifficulty;
import net.minecraft.world.EnumSkyBlock;
import net.minecraft.world.World;
import net.minecraft.world.storage.loot.LootTableList;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class EntityGrotKokkie extends EntityTameable {
private static final DataParameter<Float> DATA_HEALTH_ID = EntityDataManager
.<Float>createKey(EntityGrotKokkie.class, DataSerializers.FLOAT);
private float headRotationCourse;
private float headRotationCourseOld;
public EntityGrotKokkie(World worldIn) {
super(worldIn);
this.setSize(0.4F, 0.6F);
this.setTamed(false);
}
protected void initEntityAI() {
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, new EntityAIAttackMelee(this, 1.0D, true));
this.tasks.addTask(3, new EntityAIMate(this, 1.0D));
this.tasks.addTask(4, new EntityAIWander(this, 1.0D));
this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
this.tasks.addTask(6, new EntityAILookIdle(this));
this.tasks.addTask(7, new EntityAILeapAtTarget(this, 0.4F));
this.tasks.addTask(8, new EntityAIFollowParent(this, 1.1D));
this.tasks.addTask(9, new EntityAITempt(this, 0.9D, Items.CHICKEN, false));
this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true, new Class[0]));
this.targetTasks.addTask(2,
new EntityAITargetNonTamed(this, EntityAnimal.class, false, new Predicate<Entity>() {
public boolean apply(@Nullable Entity p_apply_1_) {
return p_apply_1_ instanceof EntitySheep || p_apply_1_ instanceof EntityRabbit
|| p_apply_1_ instanceof EntityChicken;
}
}));
}
@Override
protected ResourceLocation getLootTable() {
return KokkieLoot.ENTITIES_GROT;
}
@Override
public boolean isBreedingItem(@Nullable ItemStack stack) {
return stack == null ? false : stack.getItem() == Items.CHICKEN;
}
protected void applyEntityAttributes() {
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.30000001192092896D);
this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(2.0D);
this.getAttributeMap().registerAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(0.5D);
}
protected void updateAITasks() {
this.dataManager.set(DATA_HEALTH_ID, Float.valueOf(this.getHealth()));
}
protected void entityInit() {
super.entityInit();
this.dataManager.register(DATA_HEALTH_ID, Float.valueOf(this.getHealth()));
}
protected void playStepSound(BlockPos pos, Block blockIn) {
this.playSound(SoundEvents.ENTITY_ITEMFRAME_REMOVE_ITEM, 0.15F, 1.0F);
}
public static void func_189788_b(DataFixer p_189788_0_) {
EntityLiving.func_189752_a(p_189788_0_, "GrotKokkie");
}
protected SoundEvent getAmbientSound() {
return this.isAngry() ? KokkieSounds.GROT_KOKKIE_ANGRY
: (this.rand.nextInt(2) == 0 ? KokkieSounds.GROT_KOKKIE_AMBIENCE : KokkieSounds.GROT_KOKKIE_AMBIENCE);
}
protected SoundEvent getHurtSound() {
return KokkieSounds.GROT_KOKKIE_HURT;
}
protected SoundEvent getDeathSound() {
return KokkieSounds.GROT_KOKKIE_DEATH;
}
/**
* Returns the volume for the sounds this mob makes.
*/
protected float getSoundVolume() {
return 0.4F;
}
/**
* Called to update the entity's position/logic.
*/
public void onUpdate() {
super.onUpdate();
this.headRotationCourseOld = this.headRotationCourse;
this.headRotationCourse += (0.0F - this.headRotationCourse) * 0.4F;
}
@SideOnly(Side.CLIENT)
public float getInterestedAngle(float p_70917_1_) {
return (this.headRotationCourseOld + (this.headRotationCourse - this.headRotationCourseOld) * p_70917_1_)
* 0.15F * (float) Math.PI;
}
public float getEyeHeight() {
return this.height;
}
public int getVerticalFaceSpeed() {
return this.isSitting() ? 20 : super.getVerticalFaceSpeed();
}
public boolean attackEntityAsMob(Entity entityIn) {
boolean flag = entityIn.attackEntityFrom(DamageSource.causeMobDamage(this),
(float) ((int) this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).getAttributeValue()));
if (flag) {
this.applyEnchantments(this, entityIn);
}
return flag;
}
public EntityGrotKokkie createChild(EntityAgeable ageable) {
EntityGrotKokkie kokkie = new EntityGrotKokkie(this.worldObj);
return kokkie;
}
public boolean canMateWith(EntityAnimal otherAnimal) {
if (otherAnimal == this) {
return false;
} else if (!(otherAnimal instanceof EntityGrotKokkie)) {
return false;
} else {
EntityGrotKokkie entitywolf = (EntityGrotKokkie) otherAnimal;
return this.isInLove() && entitywolf.isInLove();
}
}
public boolean isAngry() {
return (((Byte) this.dataManager.get(TAMED)).byteValue() & 2) != 0;
}
public void setAngry(boolean angry) {
byte b0 = ((Byte) this.dataManager.get(TAMED)).byteValue();
if (angry) {
this.dataManager.set(TAMED, Byte.valueOf((byte) (b0 | 2)));
} else {
this.dataManager.set(TAMED, Byte.valueOf((byte) (b0 & -3)));
}
}
public boolean shouldAttackEntity(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_) {
if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast)) {
return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer
&& !((EntityPlayer) p_142018_2_).canAttackPlayer((EntityPlayer) p_142018_1_) ? false
: !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse) p_142018_1_).isTame();
} else {
return false;
}
}
public void setAttackTarget(@Nullable EntityLivingBase entitylivingbaseIn) {
super.setAttackTarget(entitylivingbaseIn);
if (entitylivingbaseIn == null) {
this.setAngry(false);
} else {
this.setAngry(true);
}
}
public void writeEntityToNBT(NBTTagCompound compound) {
super.writeEntityToNBT(compound);
compound.setBoolean("Angry", this.isAngry());
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(NBTTagCompound compound) {
super.readEntityFromNBT(compound);
this.setAngry(compound.getBoolean("Angry"));
}
public void onLivingUpdate() {
super.onLivingUpdate();
if (!this.worldObj.isRemote && this.getAttackTarget() == null && this.isAngry()) {
this.setAngry(false);
}
}
@Override
public boolean getCanSpawnHere() {
return super.getCanSpawnHere() && !this.worldObj.canBlockSeeSky(this.getPosition()) && this.getPosition().getY() < 55;
}
}