Advertisement
Guest User

Modding Help

a guest
Apr 4th, 2013
372
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.07 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.     public boolean isAIEnabled()
  38.     {
  39.         return true;
  40.     }
  41.        
  42.         public String getTexture()
  43.     {
  44.         return "/mob/ogre.png";
  45.     }
  46.  
  47.     public int getMaxHealth()
  48.     {
  49.         return 100;
  50.     }
  51.    
  52.     public boolean isVillager()
  53.     {
  54.         return false;
  55.     }
  56.    
  57.     protected int getDropItemId()
  58.     {
  59.                 return Item.emerald.itemID;
  60.     }
  61.    
  62.     protected void dropRareDrop(int par1)
  63.     {
  64.         switch (this.rand.nextInt(3))
  65.         {
  66.             case 0:
  67.                 this.dropItem(Item.blazeRod.itemID, 1);
  68.                 break;
  69.             case 1:
  70.                 this.dropItem(Item.ghastTear.itemID, 1);
  71.                 break;
  72.             case 2:
  73.                 this.dropItem(Item.diamond.itemID, 1);
  74.         }
  75.     }
  76.  
  77.     /**
  78.      * Makes entity wear random armor based on difficulty
  79.      */
  80.     protected void addRandomArmor()
  81.     {
  82.         super.addRandomArmor();    
  83.         this.setCurrentItemOrArmor(0, new ItemStack(Item.bow));
  84.         this.setCurrentItemOrArmor(3, new ItemStack(Item.plateDiamond));
  85.      
  86.     }
  87.    
  88.     public EnumCreatureAttribute getCreatureAttribute()
  89.     {
  90.         return EnumCreatureAttribute.UNDEAD;
  91.     }
  92.    
  93.     public int getTotalArmorValue()
  94.     {
  95.         return 20;
  96.     }
  97.    
  98.     protected void dropFewItems(boolean par1, int par2)
  99.     {
  100.         int j = this.getDropItemId();
  101.  
  102.         if (j > 0)
  103.         {
  104.             int k = this.rand.nextInt(3);
  105.  
  106.             if (par2 > 0)
  107.             {
  108.                 k += this.rand.nextInt(par2 + 1);
  109.             }
  110.  
  111.             for (int l = 0; l < k; ++l)
  112.             {
  113.                 if(!this.worldObj.isDaytime()){
  114.                         this.dropItem(j, 1);
  115.                 }
  116.             }
  117.         }
  118.     }
  119.        
  120.  
  121. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement