init.lua 930 B

12345678910111213141516171819202122232425262728293031
  1. local S = minetest.get_translator("testfood")
  2. minetest.register_craftitem("testfood:good1", {
  3. description = S("Good Food (+1)"),
  4. inventory_image = "testfood_good.png",
  5. on_use = minetest.item_eat(1),
  6. })
  7. minetest.register_craftitem("testfood:good5", {
  8. description = S("Good Food (+5)"),
  9. inventory_image = "testfood_good2.png",
  10. on_use = minetest.item_eat(5),
  11. })
  12. minetest.register_craftitem("testfood:bad1", {
  13. description = S("Bad Food (-1)"),
  14. inventory_image = "testfood_bad.png",
  15. on_use = minetest.item_eat(-1),
  16. })
  17. minetest.register_craftitem("testfood:bad5", {
  18. description = S("Bad Food (-5)"),
  19. inventory_image = "testfood_bad2.png",
  20. on_use = minetest.item_eat(-5),
  21. })
  22. minetest.register_craftitem("testfood:replace1", {
  23. description = S("Replacing Food (+1)").."\n"..
  24. S("Replaced with 'Good Food (+1)' when eaten"),
  25. inventory_image = "testfood_replace.png",
  26. on_use = minetest.item_eat(1, "testfood:good1"),
  27. })