init.lua 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. -- =============================================================================
  2. -- SOUND: https://freesound.org/people/yaplasut1843/sounds/523307/
  3. -- =============================================================================
  4. mobs:register_mob("birdie:birdie", {
  5. --nametag = "birdie" ,
  6. type = "animal",
  7. passive = true,
  8. pathfinding = true,
  9. -- reach = 0,
  10. -- damage = 0,
  11. hp_min = 8,
  12. hp_max = 5,
  13. armor = 100,
  14. collisionbox = {-0.3, -0.5, -0.3, 0.3, 0.1, 0.3},
  15. visual = "mesh",
  16. mesh = "bird.b3d",
  17. rotate = 180,
  18. textures = {
  19. {"bird_yellow.png"},
  20. {"bird_blue.png"},
  21. {"bird_brown.png"},
  22. {"bird_red.png"},
  23. {"bird_green.png"},
  24. {"bird_pink.png"}
  25. },
  26. --blood_texture = "",
  27. sounds = {
  28. random = "birdie",
  29. --death = "",
  30. },
  31. fly = true ,
  32. fly_in = "air",
  33. walk_velocity = 2,
  34. run_velocity = 4,
  35. jump_height = 3,
  36. stepheight = 2,
  37. floats = 0,
  38. view_range = 35,
  39. drops = {
  40. {name = "mobs:chicken_feather", chance = 3, min = 0, max = 1},
  41. },
  42. water_damage = 1,
  43. lava_damage = 2,
  44. light_damage = 0,
  45. animation = {
  46. speed_normal = 30,
  47. stand_start = 0,
  48. stand_end = 40,
  49. fly_start = 50,
  50. fly_end = 119,
  51. walk_start = 50,
  52. walk_end = 119,
  53. run_start = 50,
  54. run_end = 119,
  55. --punch_start = 0,
  56. --punch_end = 0,
  57. },
  58. follow = {
  59. "farming:seed_wheat",
  60. "farming:seed_cotton",
  61. },
  62. on_rightclick = function(self, clicker)
  63. if mobs:feed_tame(self, clicker, 4, true, true) then return end
  64. if mobs:protect(self, clicker) then return end
  65. if mobs:capture_mob(self, clicker, 50, 50, 90, false, nil) then return end
  66. -- by right-clicking owner can switch between staying and walking
  67. if self.owner and self.owner == clicker:get_player_name() then
  68. if self.order ~= "stand" then
  69. self.order = "stand"
  70. self.state = "stand"
  71. self.object:set_velocity({x = 0, y = 0, z = 0})
  72. mobs:set_animation(self, "stand")
  73. else
  74. self.order = ""
  75. mobs:set_animation(self, "fly")
  76. end
  77. end
  78. end,
  79. })
  80. --==============================================================================
  81. --========================= SPAWN ==============================================
  82. mobs:spawn({
  83. name = "birdie:birdie",
  84. nodes = "air",
  85. neighbors = {
  86. "default:leaves", "default:pine_needles",
  87. "default:jungleleaves"
  88. },
  89. min_light = 14,
  90. chance = 12000,
  91. min_height = 0,
  92. max_height = 200,
  93. })
  94. mobs:register_egg("birdie:birdie", "Birdie", "birdieegg.png", 1)
  95. -- =====================================================================