mirror of
https://github.com/ACGaming/Spackenmobs
synced 2024-06-11 06:58:56 +02:00
64 lines
1.9 KiB
Java
64 lines
1.9 KiB
Java
package mod.acgaming.spackenmobs.entities;
|
|
|
|
import net.minecraft.entity.EntityCreature;
|
|
import net.minecraft.entity.EntityLiving;
|
|
import net.minecraft.entity.SharedMonsterAttributes;
|
|
import net.minecraft.entity.ai.*;
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
import net.minecraft.init.SoundEvents;
|
|
import net.minecraft.util.DamageSource;
|
|
import net.minecraft.util.ResourceLocation;
|
|
import net.minecraft.util.SoundEvent;
|
|
import net.minecraft.world.World;
|
|
import net.minecraft.world.storage.loot.LootTableList;
|
|
|
|
import javax.annotation.Nullable;
|
|
|
|
public class EntityITbyHF extends EntityCreature
|
|
{
|
|
public EntityITbyHF(World worldIn)
|
|
{
|
|
super(worldIn);
|
|
this.setSize(0.6F, 2.0F);
|
|
}
|
|
|
|
protected void initEntityAI()
|
|
{
|
|
this.tasks.addTask(0, new EntityAISwimming(this));
|
|
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityLatinTeacher.class, 12.0F, 0.8D, 0.8D));
|
|
this.tasks.addTask(2, new EntityAIMoveIndoors(this));
|
|
this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this));
|
|
this.tasks.addTask(4, new EntityAIOpenDoor(this, true));
|
|
this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D));
|
|
this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F));
|
|
this.tasks.addTask(9, new EntityAIWanderAvoidWater(this, 0.6D));
|
|
this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F));
|
|
}
|
|
|
|
protected void applyEntityAttributes()
|
|
{
|
|
super.applyEntityAttributes();
|
|
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.5D);
|
|
}
|
|
|
|
protected void entityInit()
|
|
{
|
|
super.entityInit();
|
|
}
|
|
|
|
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
|
|
{
|
|
return SoundEvents.ENTITY_VILLAGER_HURT;
|
|
}
|
|
|
|
protected SoundEvent getDeathSound()
|
|
{
|
|
return SoundEvents.ENTITY_VILLAGER_DEATH;
|
|
}
|
|
|
|
@Nullable
|
|
protected ResourceLocation getLootTable()
|
|
{
|
|
return LootTableList.ENTITIES_VILLAGER;
|
|
}
|
|
} |