KcdMp.on_state_change
A hook called on every change of any bag.
Set it to a function to hear every change: scope is "global", "player" or "entity"; id the pid or entity id
(0 for the global bag); value the new string, nil when the key was removed. An error inside it is logged, never fatal.
Syntax
Section titled “Syntax”KcdMp.on_state_changeReturns
Section titled “Returns”function | nil - function(scope, id, key, value) end, or nil for no hook
Example
Section titled “Example”KcdMp.on_state_change = function(scope, id, key, value) System.LogAlways(string.format("[KcdMp] state %s %s %s = %s", scope, tostring(id), key, tostring(value)))endSee also
Section titled “See also”KcdMp.on_state · KcdMp.state · the State bags group of the index
