init.lua 976 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. local path = minetest.get_modpath("mobs_flat")
  2. mobs_flat = {}
  3. dofile(path .. "/oerkki.lua")
  4. dofile(path .. "/omsk.lua")
  5. dofile(path .. "/dustdevil.lua")
  6. dofile(path .. "/rat.lua")
  7. dofile(path .. "/dungeonmaster.lua")
  8. minetest.register_craftitem("mobs_flat:rat_caught" ,{
  9. description = "Rat",
  10. inventory_image = "mobs_flat_rat_caught.png",
  11. wield_image = "mobs_flat_rat_caught.png^[transformR90",
  12. on_place = function(itemstack, placer, pointed_thing)
  13. if pointed_thing.type ~= "node" then
  14. return
  15. end
  16. pointed_thing.under.y = pointed_thing.under.y + 1
  17. minetest.env:add_entity(pointed_thing.under, "mobs_flat:rat")
  18. itemstack:take_item()
  19. return itemstack
  20. end,
  21. })
  22. minetest.register_craftitem("mobs_flat:rat_cooked", {
  23. description = "Cooked Rat",
  24. inventory_image = "mobs_flat_rat_cooked.png",
  25. on_use = minetest.item_eat(4),
  26. cooktime = 5,
  27. })
  28. minetest.register_craft({
  29. type = "cooking",
  30. output = "mobs_flat:rat_cooked",
  31. recipe = "mobs_flat:rat_caught",
  32. })