Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package kamigreed.mod.medival.entity;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityAgeable;
- import net.minecraft.entity.EnumCreatureAttribute;
- import net.minecraft.entity.ai.EntityAIHurtByTarget;
- import net.minecraft.entity.ai.EntityAILookIdle;
- 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.ai.EntityJumpHelper;
- import net.minecraft.entity.passive.EntityAnimal;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.item.Item;
- import net.minecraft.util.MathHelper;
- import net.minecraft.world.World;
- public class EntityGoblin extends EntityAnimal{
- public EntityGoblin(World par1World)
- {
- super(par1World);
- this.texture = "/mob/goblin.png";
- this.moveSpeed = 0.8F;
- this.tasks.addTask(1, new EntityAISwimming(this));
- this.tasks.addTask(2, new EntityAIWander(null, this.moveSpeed));
- this.tasks.addTask(3, new EntityAILookIdle(this));
- this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
- this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 8.0F, 0, true));
- }
- @Override
- public EntityAgeable createChild(EntityAgeable entityageable)
- {
- return null;
- }
- @Override
- public int getMaxHealth()
- {
- return 14;
- }
- public EnumCreatureAttribute getCreatureAttribute()
- {
- return EnumCreatureAttribute.UNDEFINED;
- }
- public int getAttackStrength(Entity par1Entity)
- {
- return 2;
- }
- protected boolean isAIEnabled()
- {
- return true;
- }
- //public int getTotalArmorValue()
- //{
- // return 2;
- //}
- protected Entity findPlayerToAttack()
- {
- float f = this.getBrightness(1.0F);
- if (f < 0.5F)
- {
- double d0 = 16.0D;
- return this.worldObj.getClosestVulnerablePlayerToEntity(this, d0);
- }
- else
- {
- return null;
- }
- }
- protected String getLivingSound()
- {
- return "mob.zombie.say";
- }
- protected String getHurtSound()
- {
- return "mob.zombie.hurt";
- }
- protected String getDeathSound()
- {
- return "mob.zombie.death";
- }
- protected void playStepSound(int par1, int par2, int par3, int par4)
- {
- this.worldObj.playSoundAtEntity(this, "mob.zombie.step", 0.15F, 1.0F);
- }
- protected int getDropItemId()
- {
- return Item.goldNugget.itemID;
- }
- protected void dropRareDrop(int par1)
- {
- switch (this.rand.nextInt(2))
- {
- case 0:
- this.dropItem(Item.coal.itemID, 3);
- break;
- case 1:
- this.dropItem(Item.ingotGold.itemID, 1);
- break;
- }
- }
- protected void dropFewItems(boolean par1, int par2)
- {
- if(this.rand.nextInt(3) == 0)
- {
- this.dropItem(Item.coal.itemID, 1);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment