Advertisement
knotsman

EntityMob

Apr 24th, 2014
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. package name.ModId.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 EntityMob extends EntityMob{
  11.  
  12. public EntityMob(World par1World) {
  13. super(par1World);
  14.  
  15. }
  16.  
  17. protected String getLivingSound() {
  18. return "mob.pig.say";
  19. }
  20.  
  21. protected String getDeathSound() {
  22. return "mob.pig.death";
  23. }
  24.  
  25. protected String getHurtSound() {
  26. return "mob.pig.say";
  27. }
  28. protected void func_145780_a(int p_145780_1_, int p_145780_2_, int p_145780_3_, Block p_145780_4_)
  29. {
  30. this.playSound("mob.pig.step", 0.15F, 1.0F);
  31. }
  32.  
  33. protected Entity findPlayerToAttack() {
  34. EntityPlayer entityplayer = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D);
  35. return entityplayer != null && this.canEntityBeSeen(entityplayer) ? entityplayer : null;
  36. }
  37.  
  38. public void applyEntityAttributes() {
  39. super.applyEntityAttributes();
  40. //Max Health = default 20.0D - Min 0.0D - Max Double.MAX_VALUE
  41. this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(10.0D);
  42. // Follow Range - default 32.0D - Min 0.0D - Max 2048.0D
  43. this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(32.0D);
  44. // KnockBack Resistance - default 0.0D - Min 0.0D - Max 1.0D
  45. this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue(0.0D);
  46. // Movement Speed - defualt 0.699D- Min 0.0D - Max Double.MAX_VALUE
  47. this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.70D);
  48. // Attack Damage - default 2.0D - Min 0.0D - Max Double.MAX_VALUE
  49. this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(24.0D);
  50. }
  51.  
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement