From Minetest Developer Wiki
|This page contains unofficial Lua API documentation and is likely to be outdated or wrong.
For the official and up-to-date documentation, refer to lua_api.txt found in your Minetest installation directory under
|This page has been proposed for deletion for the following reason: "Contains unofficial and potentially outdated, redundant and inconsistent Lua API information"
If you don't think that this page should be deleted, please explain why on the talk page.
A high resolution persistent per-node timer. Can be gotten via minetest.get_node_timer(pos)
- set(timeout, elapsed) — set a timer's state.
elapsedare in seconds, and supports fractional values (0.1 etc). Will trigger the node's
timeout - elapsedseconds.
- start(timeout) — start a timer, equivalent to set(timeout, 0)
- stop() — stops the timer
- get_timeout() — current timeout in seconds, if timeout is 0, timer is inactive
- get_elapsed() — current elapsed time in seconds
- is_started() — boolean state of timer, returns true if timer is started, otherwise false