Guest User

class de l'entité

a guest
Mar 3rd, 2014
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.94 KB | None | 0 0
  1. package modendercraft;
  2.  
  3. import net.minecraft.block.Block;
  4. import net.minecraft.entity.SharedMonsterAttributes;
  5. import net.minecraft.entity.ai.EntityAIAttackOnCollide;
  6. import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
  7. import net.minecraft.entity.monster.EntityMob;
  8. import net.minecraft.entity.player.EntityPlayer;
  9. import net.minecraft.item.Item;
  10. import net.minecraft.item.ItemStack;
  11. import net.minecraft.nbt.NBTTagCompound;
  12. import net.minecraft.world.World;
  13.  
  14. public class EntityChevalier extends EntityMob
  15. {
  16.    
  17.    
  18.    
  19.     protected boolean isAIEnabled()
  20.     {
  21.         return true;
  22.     }
  23.  
  24.     public EntityChevalier(World par1World) {
  25.         super(par1World);
  26.        
  27.         this.tasks.addTask(4, new EntityAIAttackOnCollide(this, EntityPlayer.class, 0.4D, false));
  28.         this.targetTasks.addTask(7, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true));
  29.     }
  30.    
  31.    
  32.       protected void applyEntityAttributes()
  33.         {
  34.             super.applyEntityAttributes();
  35.             this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(200D);
  36.             this.getEntityAttribute(SharedMonsterAttributes.followRange).setAttribute(15.0D);
  37.             this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.69);
  38.             this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setAttribute(5);
  39.  
  40.  
  41.         }
  42.       protected String getLivingSound()
  43.         {
  44.             return "mob.blaze.breathe";
  45.         }
  46.  
  47.      protected String getHurtSound()
  48.         {
  49.             return "mob.blaze.hit";
  50.         }
  51.  
  52.      
  53.         protected String getDeathSound()
  54.         {
  55.             return "mob.blaze.death";
  56.         }
  57.  
  58.  
  59.  
  60.       protected float getSoundVolume()
  61.         {
  62.             return 0.1F;
  63.         }
  64.      
  65.       private static final ItemStack defaultHeldItem;
  66.         public ItemStack getHeldItem()
  67.         {
  68.             return defaultHeldItem;
  69.            
  70.         }
  71.        
  72.         static
  73.         {
  74.             defaultHeldItem = new ItemStack(modendercraftmain.EDG, 1);
  75.         }
  76.      
  77.      
  78. }
Advertisement
Add Comment
Please, Sign In to add comment