Skip to content
mouse114514 edited this page Sep 12, 2026 · 1 revision

When Mod Awakes

When Mod Awakes

Overview

Triggers once when the game has finished loading. It is the initialization entry point of your mod - put all registration blocks here (items, recipes, buildings, tiles, locales, statuses) so they are ready before the game uses them.

This is a hat block: it can only be placed at the top of a script, and the blocks connected below run in order when the event fires.

Slots

This block has no parameter slots.

Slot Type Description
(none) - no inputs

Connections

Connection Type Description
Top - hat block, cannot connect
Bottom Statement blocks below run in order when the event fires

Typical Uses

  • Register custom items, recipes, buildings, tiles and locale strings
  • Register status effects
  • Initialize custom variables
  • Run one-time setup commands

Example

when mod awakes
├── register item id "customSword" name "Sample Sword" desc "A test sword" sprite "sword.png"
├── recipe input list → output customSword amount 1
├── set myVar to 0
└── run command "log mod ready"

Generated Code

This block emits the patch marker //PATCH:Awake, which is injected into the Awake() method of the generated plugin class.

Block ID: cu_when_awake


中文 | Event Blocks | Block Reference

Clone this wiki locally