Core Concepts¶
Understanding the fundamental building blocks of Lands.io mods.
Overview¶
The Mod SDK is built around these core concepts:
| Concept | Purpose |
|---|---|
| Mod Class | Main entry point with lifecycle hooks |
| Configuration | Override game mechanics |
| Actions | Player abilities and AI behaviors |
| Executions | Game state mutations |
| State Management | In-game and persistent data |
| UI Components | Custom buttons and interfaces |
| Scheduler Jobs | Background tasks |
Architecture¶
graph TD
A[Mod Class] --> B[Lifecycle Hooks]
A --> C[Action Registration]
A --> D[Intent Handlers]
B --> E[onGameInit]
B --> F[onPlayerAdded]
B --> G[onGameEnd]
C --> H[Custom Actions]
H --> I[Executions]
D --> J[UI Buttons]
J --> I
I --> K[Game State]
A --> L[ModState]
A --> M[PersistentStorage]
Data Flow¶
- Player Input → UI Button or built-in action
- Intent Created → Sent to server
- Intent Handler → Validates and creates Execution
- Execution → Mutates game state
- State Sync → Changes broadcast to all clients