tree_monster.lua 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. local S = mobs.intllib
  2. -- Tree Monster (or Tree Gollum) by PilzAdam
  3. mobs:register_mob("mobs_monster:tree_monster", {
  4. type = "monster",
  5. passive = false,
  6. attack_type = "dogfight",
  7. attack_animals = true,
  8. --specific_attack = {"player", "mobs_animal:chicken"},
  9. reach = 2,
  10. damage = 2,
  11. hp_min = 7,
  12. hp_max = 33,
  13. armor = 100,
  14. collisionbox = {-0.4, -1, -0.4, 0.4, 0.8, 0.4},
  15. visual = "mesh",
  16. mesh = "mobs_tree_monster.b3d",
  17. textures = {
  18. {"mobs_tree_monster.png"},
  19. {"mobs_tree_monster2.png"},
  20. },
  21. blood_texture = "default_wood.png",
  22. makes_footstep_sound = true,
  23. sounds = {
  24. random = "mobs_treemonster",
  25. },
  26. walk_velocity = 1,
  27. run_velocity = 3,
  28. jump = true,
  29. view_range = 15,
  30. drops = {
  31. {name = "default:stick", chance = 1, min = 0, max = 2},
  32. {name = "default:sapling", chance = 2, min = 0, max = 2},
  33. {name = "default:junglesapling", chance = 3, min = 0, max = 2},
  34. {name = "default:apple", chance = 4, min = 1, max = 2},
  35. },
  36. water_damage = 0,
  37. lava_damage = 0,
  38. light_damage = 2,
  39. fall_damage = 0,
  40. immune_to = {
  41. {"default:axe_wood", 0}, -- wooden axe doesnt hurt wooden monster
  42. {"default:axe_stone", 4}, -- axes deal more damage to tree monster
  43. {"default:axe_bronze", 5},
  44. {"default:axe_steel", 5},
  45. {"default:axe_mese", 7},
  46. {"default:axe_diamond", 9},
  47. {"default:sapling", -5}, -- default and jungle saplings heal
  48. {"default:junglesapling", -5},
  49. -- {"all", 0}, -- only weapons on list deal damage
  50. },
  51. animation = {
  52. speed_normal = 15,
  53. speed_run = 15,
  54. stand_start = 0,
  55. stand_end = 24,
  56. walk_start = 25,
  57. walk_end = 47,
  58. run_start = 48,
  59. run_end = 62,
  60. punch_start = 48,
  61. punch_end = 62,
  62. },
  63. })
  64. mobs:spawn({
  65. name = "mobs_monster:tree_monster",
  66. nodes = {"default:leaves", "default:jungleleaves"},
  67. max_light = 7,
  68. chance = 7000,
  69. min_height = 0,
  70. day_toggle = false,
  71. })
  72. mobs:register_egg("mobs_monster:tree_monster", S("Tree Monster"), "default_tree_top.png", 1)
  73. mobs:alias_mob("mobs:tree_monster", "mobs_monster:tree_monster") -- compatibility