onRegisteredServer

abstract fun onRegisteredServer(configId: Identifier, listener: OnRegisteredServerListener)

Registers a listener to the global onChangedServer event. This will be fired on the logical server after an updated config is prepared for saving.

  • If the config has already been registered when this is called the listener will be fired right away

  • Otherwise, the listener will be queued and fired after the config is registered

Typically, this will happen sometime during mod initialization, but that isn't guaranteed. Fzzy Configs can be loaded lazily. This is a "common" event despite the name (fired on client and server). If the config is never loaded, or not loaded as a synced config, this listener will never be fired.

Author

fzzyhmstrs

Since

0.5.0

Parameters

configId

Identifier the registry id of the config to listen for

listener

OnRegisteredServerListener callback that is fired when any config is updated on the server side. This can be used to inspect other configs, not just your own.

See also

A direct-implementation option for inspecting your own config on change.