Initialization orders
Last updated
Was this helpful?
Last updated
Was this helpful?
A mod has two initialization phases: Pre-initialization and initialization.
Registry is a special one that always happen between preinit and init.
Preinit is called when the Blocksworld environment isn't ready yet, no blocks exist yet, no script are registered, it's the start just after the mod being loaded.
Althought using the register
function is recommended for registering stuff, pre_init
can be used for most of them, like blocks, block items and models. However pre_init
cannot be used for loading textures (due to internal reasons).
Init is more like a late init, it happens after everything else has been registered and is executed on the "Starting Blocksworld.." startup message.
Here is a table listing when something can be registered:
Register type
Pre-Init
Register
Init
Blocks
Block Items
Textures
Models
(no corresponding register)