Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.TheGoldCrayon.Daemonology.entities;
- import com.TheGoldCrayon.Daemonology.init.DaemonologyItems;
- import com.ibm.icu.impl.duration.impl.Utils;
- import net.minecraft.block.Block;
- import net.minecraft.entity.EntityAgeable;
- import net.minecraft.entity.EnumCreatureType;
- import net.minecraft.entity.SharedMonsterAttributes;
- import net.minecraft.entity.ai.EntityAIFollowParent;
- import net.minecraft.entity.ai.EntityAILookIdle;
- import net.minecraft.entity.ai.EntityAIMate;
- import net.minecraft.entity.ai.EntityAIPanic;
- import net.minecraft.entity.ai.EntityAISwimming;
- import net.minecraft.entity.ai.EntityAITempt;
- import net.minecraft.entity.ai.EntityAIWander;
- import net.minecraft.entity.ai.EntityAIWatchClosest;
- import net.minecraft.entity.passive.EntityAnimal;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.init.Items;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemStack;
- import net.minecraft.pathfinding.PathNavigateGround;
- import net.minecraft.util.BlockPos;
- import net.minecraft.world.World;
- import net.minecraft.world.biome.BiomeGenBase;
- import net.minecraftforge.fml.common.registry.EntityRegistry;
- public class EntityImp extends EntityAnimal
- {
- public EntityImp(World worldIn)
- {
- super(worldIn);
- this.setSize(0.9F, 1.3F);
- ((PathNavigateGround)this.getNavigator()).setAvoidsWater(true);
- this.tasks.addTask(0, new EntityAISwimming(this));
- this.tasks.addTask(1, new EntityAIPanic(this, 1.0D));
- this.tasks.addTask(2, new EntityAIMate(this, 1.0D));
- this.tasks.addTask(3, new EntityAITempt(this, 1.25D, Items.wheat, false));
- this.tasks.addTask(4, new EntityAIFollowParent(this, 1.25D));
- this.tasks.addTask(5, new EntityAIWander(this, 0.7D));
- this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
- this.tasks.addTask(7, new EntityAILookIdle(this));
- }
- protected void applyEntityAttributes()
- {
- super.applyEntityAttributes();
- this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D);
- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.3D);
- }
- /**
- * Returns the sound this mob makes while it's alive.
- */
- protected String getLivingSound()
- {
- return "mob.cow.say";
- }
- /**
- * Returns the sound this mob makes when it is hurt.
- */
- protected String getHurtSound()
- {
- return "mob.cow.hurt";
- }
- /**
- * Returns the sound this mob makes on death.
- */
- protected String getDeathSound()
- {
- return "mob.cow.hurt";
- }
- protected void playStepSound(BlockPos pos, Block blockIn)
- {
- this.playSound("mob.cow.step", 0.15F, 1.0F);
- }
- /**
- * Returns the volume for the sounds this mob makes.
- */
- protected float getSoundVolume()
- {
- return 0.4F;
- }
- protected Item getDropItem()
- {
- return Items.leather;
- }
- /**
- * Drop 0-2 items of this living's type
- */
- protected void dropFewItems(boolean p_70628_1_, int p_70628_2_)
- {
- int i = this.rand.nextInt(3) + this.rand.nextInt(1 + p_70628_2_);
- for (int j = 0; j < i; ++j)
- {
- this.dropItem(DaemonologyItems.item_sulfur, 1);
- }
- i = this.rand.nextInt(3) + 1 + this.rand.nextInt(1 + p_70628_2_);
- for (int k = 0; k < i; ++k)
- {
- if (this.isBurning())
- {
- this.dropItem(Items.cooked_beef, 1);
- }
- else
- {
- this.dropItem(Items.beef, 1);
- }
- }
- }
- public EntityImp createChild(EntityAgeable ageable)
- {
- return new EntityImp(this.worldObj);
- }
- public float getEyeHeight()
- {
- return this.height;
- }
- public boolean getCanSpawnHere()
- {
- return super.getCanSpawnHere();
- }
- }
Add Comment
Please, Sign In to add comment