food.lua 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. -- Banana (Heals one heart when eaten)
  2. minetest.register_node("epic_trees:banana", {
  3. description = "Banana",
  4. drawtype = "torchlike",
  5. tiles = {"banana_single.png"},
  6. inventory_image = "banana_single.png",
  7. wield_image = "banana_single.png",
  8. paramtype = "light",
  9. sunlight_propagates = true,
  10. walkable = false,
  11. selection_box = {
  12. type = "fixed",
  13. fixed = {-0.31, -0.5, -0.31, 0.31, 0.5, 0.31}
  14. },
  15. groups = {
  16. food_banana = 1, fleshy = 3, dig_immediate = 3, flammable = 2,
  17. leafdecay = 1, leafdecay_drop = 1
  18. },
  19. drop = "epic_trees:banana",
  20. on_use = minetest.item_eat(2),
  21. sounds = default.node_sound_leaves_defaults(),
  22. after_place_node = function(pos, placer)
  23. if placer:is_player() then
  24. minetest.set_node(pos, {name = "epic_trees:banana", param2 = 1})
  25. end
  26. end,
  27. })
  28. -- Orange (Heals 2 hearts when eaten)
  29. minetest.register_node("epic_trees:orange", {
  30. description = "Orange",
  31. drawtype = "plantlike",
  32. tiles = {"farming_orange.png"},
  33. inventory_image = "farming_orange.png",
  34. wield_image = "farming_orange.png",
  35. paramtype = "light",
  36. sunlight_propagates = true,
  37. walkable = false,
  38. selection_box = {
  39. type = "fixed",
  40. fixed = {-0.27, -0.37, -0.27, 0.27, 0.44, 0.27}
  41. },
  42. groups = {
  43. food_orange = 1, fleshy = 3, dig_immediate = 3, flammable = 2,
  44. leafdecay = 3, leafdecay_drop = 1
  45. },
  46. drop = "epic_trees:orange",
  47. on_use = minetest.item_eat(4),
  48. sounds = default.node_sound_leaves_defaults(),
  49. after_place_node = function(pos, placer)
  50. if placer:is_player() then
  51. minetest.set_node(pos, {name = "epic_trees:orange", param2 = 1})
  52. end
  53. end,
  54. })