minetest-mods/toolranks/README.md

28 lines
666 B
Markdown
Raw Normal View History

2021-05-16 18:16:47 +02:00
# minetest-toolranks [toolranks]
2019-12-14 17:47:31 +01:00
Minetest tool ranks mod
2021-05-16 18:16:47 +02:00
Tools gain levels for digging nodes. Higher level tools dig faster and take longer to wear out.
2019-12-14 17:47:31 +01:00
## Are you a mod developer?
2021-05-16 18:16:47 +02:00
2019-12-14 17:47:31 +01:00
Does one of your mods add new tools?
2021-05-16 18:16:47 +02:00
If so, to support this mod, add this code to your mod, after your tool's code:
```lua
if minetest.get_modpath("toolranks") then
minetest.override_item("mymod:mytool", {
original_description = "My Tool",
description = toolranks.create_description("My Tool"),
after_use = toolranks.new_afteruse
})
end
end
```
Or alternatively, you can use the helper function:
```lua
toolranks.add_tool("mymod:mytool")
```