minetest.get_dig_params

From Minetest Developer Wiki
Jump to: navigation, search


Syntax

minetest.get_dig_params(groups, tool_capabilities[, time_from_last_punch])

Description

These are the parameters:

  • groups: the groups of some item
  • tool_capabilities: a table, obtain it with itemstack:get_tool_capabilities()
  • time_from_last_punch: you can ignore this, it's used for anticheat

A table with following fields is returned:

  • diggable: tells if the node can be dug with the passed tool capabilities
  • time: the time the node takes to be dug; note that this value can be smaller than 0.15, whereas when real players dig a node the time is set to 0.15 if it's smaller (tested 10.04.2017, see [https://github.com/minetest/minetest/blob/master/src/game.cpp#L3888 game.cpp:3888)
  • wear: the value which would be taken from the tool's toolwear after digging

This article is missing examples, feel free to add them.


Personal tools
Namespaces

Variants
Actions
Navigation
API
Toolbox