Exdilin
  • Initial page
  • Coloring Text (speech bubble)
  • Concepts
    • Initialization orders
  • Lua Mods
    • Introduction
    • Adding Blocks
    • Custom Textures
    • Sound of Mods
  • Glosarry
    • Rarity Levels
    • Texture Mappings
Powered by GitBook
On this page

Was this helpful?

  1. Concepts

Initialization orders

PreviousColoring Text (speech bubble)NextIntroduction

Last updated 4 years ago

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)

✅
✅
❎
✅
✅
❎
❎
✅
✅
✅
❎
✅