penguin.lua 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. local S = mobs.intllib
  2. -- Penguin by D00Med
  3. mobs:register_mob("mobs_animal:penguin", {
  4. stepheight = 0.6,
  5. type = "animal",
  6. passive = true,
  7. reach = 1,
  8. hp_min = 5,
  9. hp_max = 10,
  10. armor = 200,
  11. collisionbox = {-0.2, -0.0, -0.2, 0.2, 0.5, 0.2},
  12. visual = "mesh",
  13. mesh = "mobs_penguin.b3d",
  14. visual_size = {x = 0.25, y = 0.25},
  15. textures = {
  16. {"mobs_penguin.png"},
  17. },
  18. sounds = {},
  19. makes_footstep_sound = true,
  20. walk_velocity = 1,
  21. run_velocity = 2,
  22. runaway = true,
  23. jump = false,
  24. stepheight = 1.1,
  25. drops = {
  26. {name = "mobs:meat_raw", chance = 1, min = 1, max = 1},
  27. },
  28. water_damage = 0,
  29. lava_damage = 4,
  30. light_damage = 0,
  31. fear_height = 2,
  32. animation = {
  33. speed_normal = 15,
  34. stand_start = 1,
  35. stand_end = 20,
  36. walk_start = 25,
  37. walk_end = 45,
  38. fly_start = 75, -- swim animation
  39. fly_end = 95,
  40. -- 50-70 is slide/water idle
  41. },
  42. fly_in = {"default:water_source", "default:water_flowing"},
  43. floats = 0,
  44. follow = {
  45. "group:food_fish_raw", "mobs_fish:clownfish", "mobs_fish:tropical",
  46. "mobs_fish:clownfish_set", "mobs_fish:tropical_set", "xocean:fish_edible"
  47. },
  48. view_range = 5,
  49. on_rightclick = function(self, clicker)
  50. -- feed or tame
  51. if mobs:feed_tame(self, clicker, 4, false, true) then return end
  52. if mobs:protect(self, clicker) then return end
  53. if mobs:capture_mob(self, clicker, 5, 50, 80, false, nil) then return end
  54. end,
  55. })
  56. if not mobs.custom_spawn_animal then
  57. mobs:spawn({
  58. name = "mobs_animal:penguin",
  59. nodes = {"default:snowblock"},
  60. min_light = 14,
  61. interval = 60,
  62. chance = 20000,
  63. min_height = 0,
  64. max_height = 200,
  65. day_toggle = true,
  66. })
  67. end
  68. mobs:register_egg("mobs_animal:penguin", S("Penguin"), "mobs_penguin_inv.png")