Advertisement
Guest User

EntityDragonKnight

a guest
Feb 6th, 2013
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.71 KB | None | 0 0
  1. package mod.ElementalWorld;
  2.  
  3. import net.minecraft.src.Entity;
  4. import net.minecraft.src.EntityAIAttackOnCollide;
  5. import net.minecraft.src.EntityAIHurtByTarget;
  6. import net.minecraft.src.EntityAINearestAttackableTarget;
  7. import net.minecraft.src.EntityAISwimming;
  8. import net.minecraft.src.EntityAIWander;
  9. import net.minecraft.src.EntityAIWatchClosest;
  10. import net.minecraft.src.EntityMob;
  11. import net.minecraft.src.EntityPlayer;
  12. import net.minecraft.src.EnumCreatureAttribute;
  13. import net.minecraft.src.Item;
  14. import net.minecraft.src.ItemStack;
  15. import net.minecraft.src.World;
  16.  
  17. public class EntityDragonKnight extends EntityMob
  18. {
  19.  public EntityDragonKnight(World par1World)
  20.  {
  21.   super(par1World);
  22.   this.texture = "/textures/Dragon Knight.png";
  23.   this.moveSpeed = 0.25F;
  24.   this.tasks.addTask(0, new EntityAISwimming(this));
  25.   this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityPlayer.class, this.moveSpeed, false));
  26.   this.tasks.addTask(4, new EntityAIWander(this, this.moveSpeed));
  27.   this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
  28.   this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
  29.   this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 16.0F, 0, true));
  30.   this.canPickUpLoot = true;
  31.   this.setCurrentItemOrArmor(0, new ItemStack(Item.swordSteel));
  32. }
  33.  
  34.  public EnumCreatureAttribute getCreatureAttribute()
  35.  {
  36.      return EnumCreatureAttribute.UNDEFINED;
  37.  }
  38.  
  39.  public int getAttackStrength(Entity par1Entity)
  40.  {
  41.   return 10;
  42.  }
  43.  
  44.  protected boolean isAIEnabled()
  45.  {
  46.      return true;
  47.  }
  48.  
  49.  public int getTotalArmorValue()
  50.  {
  51.      return 16;
  52.  }
  53.  
  54.  protected String getLivingSound()
  55.  {
  56.      return "mob.zombie.say";
  57.  }
  58.  
  59.  protected String getHurtSound()
  60.  {
  61.      return "mob.zombie.hurt";
  62.  }
  63.  
  64.  protected String getDeathSound()
  65.  {
  66.      return "mob.zombie.death";
  67.  }
  68.  
  69.  protected void playStepSound(int par1, int par2, int par3, int par4)
  70.  {
  71.      this.worldObj.playSoundAtEntity(this, "mob.zombie.step", 0.15F, 1.0F);
  72.  }
  73.  
  74.  protected int getDropItemId()
  75.  {
  76.      return ElementalWorld.magicEco.shiftedIndex;
  77.  }
  78.  
  79.  protected void dropRareDrop(int par1)
  80.  {
  81.      switch (this.rand.nextInt(2))
  82.      {
  83.          case 0:
  84.              this.dropItem(Item.ingotIron.shiftedIndex, 1);
  85.              break;
  86.          case 1:
  87.              this.dropItem(Item.helmetSteel.shiftedIndex, 1);
  88.              break;
  89.      }
  90.  }
  91.  
  92.  public void initCreature()
  93.  {
  94.       this.canPickUpLoot = true;
  95.       this.setCurrentItemOrArmor(0, new ItemStack(Item.swordSteel));
  96.  }
  97.  
  98.  public int getMaxHealth()
  99.  {
  100.   return 20;
  101.  }
  102.  
  103.  public String getTexture()
  104.  {
  105. return "/textures/ElementalWorld/Dragon Knight.png";
  106.  }
  107.  
  108.  
  109. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement