tools.lua 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --TOOLS
  2. minetest.register_tool('bees:smoker', {
  3. description = 'Hive Smoker',
  4. inventory_image = 'bees_smoker.png',
  5. tool_capabilities = {
  6. full_punch_interval = 3.0,
  7. max_drop_level=0,
  8. damage_groups = {fleshy=2},
  9. },
  10. on_use = function(tool, user, node)
  11. if node then
  12. local pos = node.under
  13. if pos then
  14. for i=1,6 do
  15. minetest.add_particle({
  16. pos = {x=pos.x+math.random()-0.5, y=pos.y, z=pos.z+math.random()-0.5},
  17. vel = {x=0,y=0.5+math.random(),z=0},
  18. acc = {x=0,y=0,z=0},
  19. expirationtime = 2+math.random(2.5),
  20. size = math.random(3),
  21. collisiondetection = false,
  22. texture = 'tnt_smoke.png',
  23. })
  24. end
  25. --tool:add_wear(2)
  26. local meta = minetest.get_meta(pos)
  27. meta:set_int('agressive', 0)
  28. return nil
  29. end
  30. end
  31. end,
  32. })
  33. minetest.register_tool('bees:grafting_tool', {
  34. description = 'Beehive Grafting Tool',
  35. inventory_image = 'bees_grafting_tool.png',
  36. tool_capabilities = {
  37. full_punch_interval = 3.0,
  38. max_drop_level=0,
  39. damage_groups = {fleshy=2},
  40. },
  41. })