Advertisement
Guest User

Untitled

a guest
Apr 4th, 2013
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.86 KB | None | 0 0
  1. package papy.biere;
  2.  
  3. import net.minecraft.entity.Entity;
  4. import net.minecraft.entity.EnumCreatureAttribute;
  5. import net.minecraft.entity.ai.EntityAIAttackOnCollide;
  6. import net.minecraft.entity.ai.EntityAIBreakDoor;
  7. import net.minecraft.entity.ai.EntityAIHurtByTarget;
  8. import net.minecraft.entity.ai.EntityAILookIdle;
  9. import net.minecraft.entity.ai.EntityAIMoveThroughVillage;
  10. import net.minecraft.entity.ai.EntityAIMoveTwardsRestriction;
  11. import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
  12. import net.minecraft.entity.ai.EntityAISwimming;
  13. import net.minecraft.entity.ai.EntityAIWander;
  14. import net.minecraft.entity.ai.EntityAIWatchClosest;
  15. import net.minecraft.entity.monster.EntityZombie;
  16. import net.minecraft.entity.passive.EntityVillager;
  17. import net.minecraft.entity.player.EntityPlayer;
  18. import net.minecraft.item.Item;
  19. import net.minecraft.item.ItemStack;
  20. import net.minecraft.world.World;
  21.  
  22. public class EntityOgre extends EntityZombie{
  23.  
  24.     public EntityOgre(World par1World) {
  25.        
  26.         super(par1World);
  27.         this.moveSpeed = 0.80F;
  28.         this.texture = "/mob/ogre.png";
  29.        
  30.        
  31.     }
  32.    
  33.     public int getAttackStrength(Entity par1Entity)
  34.     {
  35.         return 50;
  36.     }
  37.    
  38.     public String getTexture()
  39.     {
  40.         return "/mob/ogre.png";
  41.     }
  42.  
  43.     public int getMaxHealth()
  44.     {
  45.         return 100;
  46.     }
  47.    
  48.     public boolean isVillager()
  49.     {
  50.         return false;
  51.     }
  52.    
  53.     protected int getDropItemId()
  54.     {
  55.             return Item.emerald.itemID;
  56.     }
  57.    
  58.     protected void dropRareDrop(int par1)
  59.     {
  60.         switch (this.rand.nextInt(3))
  61.         {
  62.             case 0:
  63.                 this.dropItem(Item.blazeRod.itemID, 1);
  64.                 break;
  65.             case 1:
  66.                 this.dropItem(Item.ghastTear.itemID, 1);
  67.                 break;
  68.             case 2:
  69.                 this.dropItem(Item.diamond.itemID, 1);
  70.         }
  71.     }
  72.  
  73.     /**
  74.      * Makes entity wear random armor based on difficulty
  75.      */
  76.     protected void addRandomArmor()
  77.     {
  78.         super.addRandomArmor();    
  79.         this.setCurrentItemOrArmor(0, new ItemStack(Item.bow));
  80.         this.setCurrentItemOrArmor(3, new ItemStack(Item.plateDiamond));
  81.      
  82.     }
  83.    
  84.     public EnumCreatureAttribute getCreatureAttribute()
  85.     {
  86.         return EnumCreatureAttribute.UNDEAD;
  87.     }
  88.    
  89.     public int getTotalArmorValue()
  90.     {
  91.         return 20;
  92.     }
  93.    
  94.     protected void dropFewItems(boolean par1, int par2)
  95.     {
  96.         int j = this.getDropItemId();
  97.  
  98.         if (j > 0)
  99.         {
  100.             int k = this.rand.nextInt(3);
  101.  
  102.             if (par2 > 0)
  103.             {
  104.                 k += this.rand.nextInt(par2 + 1);
  105.             }
  106.  
  107.             for (int l = 0; l < k; ++l)
  108.             {
  109.                 if(!this.worldObj.isDaytime()){
  110.                     this.dropItem(j, 1);
  111.                 }
  112.             }
  113.         }
  114.     }
  115.    
  116.  
  117. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement