/******************************************************************************* * AbyssalCraft * Copyright (c) 2012 - 2017 Shinoow. * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Lesser Public License v3 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/lgpl-3.0.txt * * Contributors: * Shinoow - implementation ******************************************************************************/ package com.shinoow.abyssalcraft.common.entity; import net.minecraft.block.Block; import net.minecraft.entity.EnumCreatureAttribute; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.EntityAIAttackMelee; import net.minecraft.entity.ai.EntityAIHurtByTarget; import net.minecraft.entity.ai.EntityAILookIdle; import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; import net.minecraft.entity.ai.EntityAINearestAttackableTarget; import net.minecraft.entity.ai.EntityAISwimming; 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.init.SoundEvents; import net.minecraft.item.Item; import net.minecraft.util.SoundEvent; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import com.shinoow.abyssalcraft.api.entity.IAntiEntity; import com.shinoow.abyssalcraft.api.entity.ICoraliumEntity; import com.shinoow.abyssalcraft.api.entity.IDreadEntity; import com.shinoow.abyssalcraft.api.item.ACItems; import com.shinoow.abyssalcraft.lib.ACConfig; public class EntityOmotholWarden extends EntityMob implements IAntiEntity, ICoraliumEntity, IDreadEntity { public EntityOmotholWarden(World par1World) { super(par1World); tasks.addTask(0, new EntityAISwimming(this)); tasks.addTask(2, new EntityAIAttackMelee(this, 0.35D, false)); tasks.addTask(3, new EntityAIMoveTowardsRestriction(this, 0.35D)); tasks.addTask(4, new EntityAIWander(this, 0.35D)); tasks.addTask(7, new EntityAILookIdle(this)); tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); targetTasks.addTask(1, new EntityAIHurtByTarget(this, false)); targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); } @Override protected void applyEntityAttributes() { super.applyEntityAttributes(); getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(64.0D); getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(0.2D); if(ACConfig.hardcoreMode){ getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(400.0D); getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(30.0D); } else { getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(200.0D); getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(15.0D); } } @Override public boolean canBreatheUnderwater() { return true; } @Override protected SoundEvent getAmbientSound() { return SoundEvents.ENTITY_ZOMBIE_AMBIENT; } @Override protected SoundEvent getHurtSound() { return SoundEvents.ENTITY_ZOMBIE_HURT; } @Override protected SoundEvent getDeathSound() { return SoundEvents.ENTITY_ZOMBIE_DEATH; } @Override protected void playStepSound(BlockPos pos, Block par4) { playSound(SoundEvents.ENTITY_ZOMBIE_STEP, 0.15F, 1.0F); } @Override protected Item getDropItem() { return ACItems.life_crystal; } @Override public EnumCreatureAttribute getCreatureAttribute() { return EnumCreatureAttribute.UNDEAD; } }