panda.lua 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. local S = mobs.intllib
  2. -- Panda by AspireMint (CC BY-SA 3.0)
  3. mobs:register_mob("mobs_animal:panda", {
  4. stepheight = 0.6,
  5. type = "animal",
  6. passive = false,
  7. attack_type = "dogfight",
  8. group_attack = false,
  9. owner_loyal = true,
  10. attack_npcs = false,
  11. reach = 2,
  12. damage = 3,
  13. hp_min = 10,
  14. hp_max = 24,
  15. armor = 200,
  16. collisionbox = {-0.4, -0.45, -0.4, 0.4, 0.45, 0.4},
  17. visual = "mesh",
  18. mesh = "mobs_panda.b3d",
  19. textures = {
  20. {"mobs_panda.png"},
  21. },
  22. makes_footstep_sound = true,
  23. sounds = {
  24. random = "mobs_panda",
  25. attack = "mobs_panda",
  26. },
  27. walk_chance = 5,
  28. walk_velocity = 0.5,
  29. run_velocity = 1.5,
  30. jump = false,
  31. jump_height = 6,
  32. follow = {"ethereal:bamboo", "bamboo:trunk"},
  33. view_range = 8,
  34. drops = {
  35. {name = "mobs:meat_raw", chance = 1, min = 1, max = 2},
  36. },
  37. water_damage = 0,
  38. lava_damage = 5,
  39. light_damage = 0,
  40. fear_height = 6,
  41. animation = {
  42. speed_normal = 15,
  43. stand_start = 130,
  44. stand_end = 270,
  45. stand1_start = 0,
  46. stand1_end = 0,
  47. stand2_start = 1,
  48. stand2_end = 1,
  49. stand3_start = 2,
  50. stand3_end = 2,
  51. walk_start = 10,
  52. walk_end = 70,
  53. run_start = 10,
  54. run_end = 70,
  55. punch_start = 80,
  56. punch_end = 120,
  57. -- 0 = rest, 1 = hiding (covers eyes), 2 = surprised
  58. },
  59. on_rightclick = function(self, clicker)
  60. if mobs:feed_tame(self, clicker, 20, true, true) then return end
  61. if mobs:protect(self, clicker) then return end
  62. if mobs:capture_mob(self, clicker, 0, 5, 50, false, nil) then return end
  63. end,
  64. })
  65. if minetest.get_modpath("ethereal") and not mobs.custom_spawn_animal then
  66. mobs:spawn({
  67. name = "mobs_animal:panda",
  68. nodes = {"ethereal:bamboo_dirt"},
  69. neighbors = {"group:grass"},
  70. min_light = 14,
  71. interval = 60,
  72. chance = 8000, -- 15000
  73. min_height = 10,
  74. max_height = 80,
  75. day_toggle = true,
  76. })
  77. end
  78. mobs:register_egg("mobs_animal:panda", S("Panda"), "mobs_panda_inv.png")