Advertisement
LamboSV

EntityCyborgCreeper

Mar 31st, 2013
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.49 KB | None | 0 0
  1. package CyborgCreeperPackage;
  2.  
  3. import net.minecraft.entity.ai.*;
  4. import net.minecraft.entity.monster.EntityMob;
  5. import net.minecraft.entity.passive.EntityOcelot;
  6. import net.minecraft.entity.player.EntityPlayer;
  7. import net.minecraft.item.Item;
  8. import net.minecraft.world.World;
  9. import net.minecraft.item.*;
  10. import net.minecraft.block.*;
  11.  
  12.  
  13. public class EntityCyborgCreeper extends EntityMob {
  14.  
  15.     public EntityCyborgCreeper(World par1World) {
  16.         super(par1World);
  17.         this.texture = "/textures/mobs/Cyborg Creeper.png";
  18.         this.setSize(0.5F, 2.0F);
  19.         this.tasks.addTask(1, new EntityAISwimming(this));
  20.         this.tasks.addTask(2, new EntityAIAvoidEntity(this, EntityOcelot.class, 6.0F, 0.25F, 0.3F));
  21.         this.tasks.addTask(3, new EntityAIAttackOnCollide(this, 0.25F, false));
  22.         this.tasks.addTask(4, new EntityAIWander(this, 0.4F));
  23.         this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
  24.         this.tasks.addTask(5, new EntityAILookIdle(this));
  25.         this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 16.0F, 0, true));
  26.         this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false));
  27.     }
  28.     public boolean isAIEnabled()
  29.     {
  30.         return true;
  31.     }
  32.    
  33.        public int func_82143_as()
  34.         {
  35.             return this.getAttackTarget() == null ? 3 : 3 + (this.health - 2);
  36.         }
  37.  
  38.        
  39.      
  40.     public int getMaxHealth() {
  41.         return 100;
  42.     }
  43.    
  44.    
  45.    
  46.        
  47.     protected void dropFewItems(boolean par1, int par2)
  48.     {
  49.        
  50.             this.dropItem(Item.ingotIron.itemID, 5);
  51.             this.dropItem(Item.gunpowder.itemID, 10);
  52.             this.dropItem(Item.emerald.itemID, 1);
  53.             }
  54.    
  55.            
  56.            
  57. }package CyborgCreeperPackage;
  58.  
  59. import net.minecraft.entity.ai.*;
  60. import net.minecraft.entity.monster.EntityMob;
  61. import net.minecraft.entity.passive.EntityOcelot;
  62. import net.minecraft.entity.player.EntityPlayer;
  63. import net.minecraft.item.Item;
  64. import net.minecraft.world.World;
  65. import net.minecraft.item.*;
  66. import net.minecraft.block.*;
  67.  
  68.  
  69. public class EntityCyborgCreeper extends EntityMob {
  70.  
  71.     public EntityCyborgCreeper(World par1World) {
  72.         super(par1World);
  73.         this.texture = "/mobs/CyborgCreeper.png";
  74.         this.setSize(0.5F, 2.0F);
  75.         this.tasks.addTask(1, new EntityAISwimming(this));
  76.         this.tasks.addTask(2, new EntityAIAvoidEntity(this, EntityOcelot.class, 6.0F, 0.25F, 0.3F));
  77.         this.tasks.addTask(3, new EntityAIAttackOnCollide(this, 0.25F, false));
  78.         this.tasks.addTask(4, new EntityAIWander(this, 0.4F));
  79.         this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
  80.         this.tasks.addTask(5, new EntityAILookIdle(this));
  81.         this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 16.0F, 0, true));
  82.         this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false));
  83.     }
  84.     public boolean isAIEnabled()
  85.     {
  86.         return true;
  87.     }
  88.    
  89.        public int func_82143_as()
  90.         {
  91.             return this.getAttackTarget() == null ? 3 : 3 + (this.health - 2);
  92.         }
  93.  
  94.        
  95.      
  96.     public int getMaxHealth() {
  97.         return 100;
  98.     }
  99.    
  100.    
  101.    
  102.        
  103.     protected void dropFewItems(boolean par1, int par2)
  104.     {
  105.        
  106.             this.dropItem(Item.ingotIron.itemID, 5);
  107.             this.dropItem(Item.gunpowder.itemID, 10);
  108.             this.dropItem(Item.emerald.itemID, 1);
  109.             }
  110.    
  111.            
  112.            
  113. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement