Job Control Mod

A more flexible alternative to the builtin minetest.after function

API / Library

Job Control offers a more flexible alternative to the builtin minetest.after function.

There are two ways to install Job Control: either as a typical mod within the directory structure of your game or by replacing the file 'builtin/common/after.lua' (be sure to create a backup of the original file). The latter has the advantage that it eliminates the small degree of overhead from an extraneous globalstep running in the background.

A job can be scheduled in the typical fashion, thus ensuring backward compatibility:

Each job object has access to the following methods and properties:

As mentioned earlier, it is also possible to cycle a job simply by returning true in the callback. This can be useful for tasks that must be performed at regular intervals, such as writing data files to disk. Bear in mind, however, that this isn't a replacement for an actual synchronized timer since the callback execution itself can incur a marginal delay during each iteration.

Ratings and Reviews


Do you recommend this mod?