Advertisement
Guest User

Hunch Entity

a guest
Apr 7th, 2014
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. package infectModding.mob.entity;
  2.  
  3. import net.minecraft.block.Block;
  4. import net.minecraft.entity.Entity;
  5. import net.minecraft.entity.SharedMonsterAttributes;
  6. import net.minecraft.entity.monster.EntityMob;
  7. import net.minecraft.entity.player.EntityPlayer;
  8. import net.minecraft.world.World;
  9.  
  10. public class EntityHunch extends EntityMob {
  11.  
  12. public EntityHunch(World par1World) {
  13. super(par1World);
  14. this.setSize(1.0F, 0.5F);
  15. // TODO Auto-generated constructor stub
  16. }
  17.  
  18. protected String getLivingSound(){
  19. return "mob.wither.idle";
  20. }
  21.  
  22. protected String getDeathSound(){
  23. return "mob.wither.death";
  24. }
  25.  
  26. protected String getHurtSound(){
  27. return "mob.wither.hurt";
  28. }
  29.  
  30. protected void func_145780_a(int p_145780_1_, int p_145780_2_, int p_145780_3_, Block p_145780_4_)
  31. {
  32. this.playSound("mob.pig.step", 0.15F, 1.0F);
  33. }
  34.  
  35. protected Entity findPlayerToAttack(){
  36. EntityPlayer entityPlayer = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D);
  37. return entityPlayer != null && this.canEntityBeSeen(entityPlayer) ? entityPlayer : null;
  38.  
  39. }
  40.  
  41. public void applyEntityAttributes(){
  42. super.applyEntityAttributes();
  43.  
  44. this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(10.0D);
  45. this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(52.0D);
  46. this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue(0.D);
  47. this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.9D);
  48. this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(3.0D);
  49.  
  50.  
  51.  
  52.  
  53. }
  54.  
  55.  
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement