MineClone2/mods/CORE/mcl_util/API.md

672 B

mcl_util

Provide utility functions for mcl2

mcl_util.register_player_globalstep(def)

Used to register a player globalstep. Use this insteed of global step if you need to execute action on all players to avoid calling the same functions multiple time.

mcl_util.register_player_globalstep({
	can_execute = function(dtime)
		return true --return false if you want to skip "execute" function
	end,
	execute = function(player, dtime)
		--do some cool stuff
        --will be executed for every player at each server step
	end,
	after_execute = function(dtime)
	end,
})

mcl_util.registered_player_globalstep

Table containing all registered player globalstep.