register_timer

Description

register_timer 🔗

PERSISTENT timers for Luanti mods.

local register_timer, get_timer = dofile(core.get_modpath('register_timer')..'/init.lua')

local returns_the_timer = register_timer({
  name = 'grow_tree',
  action = function(job, pos, param2)
    grow_tree(pos)
  end,
})

local grow_tree_timer = get_timer('grow_tree')

assert(grow_tree_timer == returns_the_timer)

local cancel = grow_tree_timer(10, {x,y,z}, math.random(0,3))

cancel()

Timers are stored in the mod storage. They are restarted when all mods are loaded.

If you enjoy my work, you can support me here: 💖 Donate

Thank you for helping me keep modding and sharing fun with everyone!

Reviews

Review

Do you recommend this mod?

  • No reviews, yet.

Releases

2026-03-24 21:51 UTC

0.0.1 🔗

0.0.1

  • Fix runtime errors.
2026-03-23 11:58 UTC

0.0.0 🔗

Changelog

0.0.0

  • A fully capable persistent timer utility.
  • Module that returns register_timer and get_timer.
All releases

Information

Provides

register_timer

Dependencies

Required
No required dependencies

Information

Type
Mod
Technical Name
register_timer
Languages
English
License
LGPL-2.1-only
Maintenance State
Actively Developed
Added
2026-03-23 11:58 UTC
Maintainers
Bas080