init.lua 1.2 KB

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