init.lua 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. rat = rat or {}
  2. rat.modpath = minetest.get_modpath("rat")
  3. -- Rat by PilzAdam. Modified for MustTest by MustTest.
  4. mobs.register_mob("rat:rat", {
  5. type = "animal",
  6. passive = true,
  7. hp_min = 1,
  8. hp_max = 4,
  9. armor = 200,
  10. collisionbox = {-0.2, -1, -0.2, 0.2, -0.8, 0.2},
  11. visual = "mesh",
  12. mesh = "rat_rat.b3d",
  13. textures = {
  14. {"rat_rat1.png"},
  15. {"rat_rat2.png"},
  16. },
  17. makes_footstep_sound = false,
  18. sounds = {
  19. random = "rat_rat",
  20. },
  21. walk_velocity = 1,
  22. run_velocity = 2,
  23. runaway = true,
  24. jump = true,
  25. water_damage = 0,
  26. lava_damage = 4,
  27. makes_bones_in_lava = false,
  28. light_damage = 0,
  29. fear_height = 2,
  30. on_rightclick = function(self, clicker)
  31. mobs.capture_mob(self, clicker, 96, 100, 100, true, nil)
  32. end,
  33. })
  34. -- Obtainable by players.
  35. mobs.register_egg("rat:rat", "Rat", "rat_inventory_rat.png", 0)
  36. minetest.register_craftitem("rat:rat_cooked", {
  37. description = "Cooked Rat",
  38. inventory_image = "rat_inventory_cooked_rat.png",
  39. on_use = minetest.item_eat(3),
  40. })
  41. minetest.register_craft({
  42. type = "cooking",
  43. output = "rat:rat_cooked",
  44. recipe = "rat:rat",
  45. cooktime = 5,
  46. })
  47. minetest.register_craft({
  48. type = "cooking",
  49. output = "rat:rat_cooked",
  50. recipe = "rat:rat_set",
  51. cooktime = 5,
  52. })