pig.lua 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. mobs:register_mob('farm_mobs:pig', {
  2. type = 'animal',
  3. passive = true,
  4. attack_type = 'dogfight',
  5. group_attack = true,
  6. reach = 2,
  7. damage = 4,
  8. hp_min = 5,
  9. hp_max = 20,
  10. armor = 100,
  11. collisionbox = {-0.375, 0, -0.375, 0.375, .75, 0.375},
  12. visual = 'mesh',
  13. visual_size = {x=10,y=10},
  14. mesh = 'farm_mobs_pig.b3d',
  15. textures = {
  16. {'farm_mobs_pig_pink.png'},
  17. },
  18. makes_footstep_sound = true,
  19. sounds = {
  20. random = 'farm_mobs_pig',
  21. },
  22. walk_velocity = 1,
  23. run_velocity = 2,
  24. jump = true,
  25. drops = {
  26. {name = 'mobs:pork_raw', chance = 1, min = 1, max = 5},
  27. {name = 'bonemeal:bone', chance = 2, min = 1, max = 4},
  28. },
  29. water_damage = 1,
  30. lava_damage = 5,
  31. light_damage = 0,
  32. animation = {
  33. speed_normal = 30,
  34. speed_run = 30,
  35. stand_start = 0,
  36. stand_end = 89,
  37. walk_start = 90,
  38. walk_end = 129,
  39. run_start = 130,
  40. run_end = 169,
  41. },
  42. follow = {'farming:corn', 'default:apple'},
  43. view_range = 7,
  44. fear_height = 2,
  45. on_rightclick = function(self, clicker)
  46. if mobs:feed_tame(self, clicker, 8, true, true) then
  47. return
  48. end
  49. mobs:capture_mob(self, clicker, 0, 5, 60, false, nil)
  50. end,
  51. })
  52. mobs:spawn({
  53. name = 'farm_mobs:pig',
  54. nodes = {'default:dirt_with_grass', 'default:dirt'},
  55. min_height = -5,
  56. max_height = 100,
  57. interval = 64,
  58. chance = 10000,
  59. active_object_count = 5,
  60. })
  61. mobs:register_egg("farm_mobs:pig", "Pig", "default_grass.png", 1)