init.lua 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. if not minetest.global_exists("rat") then rat = {} end
  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*500,
  9. hp_max = 4*500,
  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. death = "rat_die",
  22. },
  23. walk_velocity = 1,
  24. run_velocity = 2,
  25. runaway = true,
  26. jump = true,
  27. water_damage = 0,
  28. lava_damage = 4*500,
  29. makes_bones_in_lava = false,
  30. light_damage = 0,
  31. fear_height = 2,
  32. on_rightclick = function(self, clicker)
  33. mobs.capture_mob(self, clicker, 96, 100, 100, true, nil)
  34. end,
  35. })
  36. -- Obtainable by players.
  37. mobs.register_egg("rat:rat", "Rat", "rat_inventory_rat.png", 0)
  38. minetest.register_craftitem("rat:rat_cooked", {
  39. description = "Cooked Rat",
  40. inventory_image = "rat_inventory_cooked_rat.png",
  41. on_use = minetest.item_eat(3),
  42. })
  43. minetest.register_craft({
  44. type = "cooking",
  45. output = "rat:rat_cooked",
  46. recipe = "rat:rat",
  47. cooktime = 5,
  48. })
  49. minetest.register_craft({
  50. type = "cooking",
  51. output = "rat:rat_cooked",
  52. recipe = "rat:rat_set",
  53. cooktime = 5,
  54. })