Atomicoffe Lua API
Atomicoffe exposes a rich Lua scripting API that lets you modify Minecraft server and client behaviour without writing a Java mod.
Script Phases
Scripts are organised into three phases, each with its own directory inside <gameDir>/atomicoffe/:
| Phase | Directory | Runs On | Use For |
|---|---|---|---|
| Startup | startup_scripts/ | Mod init | Item/block registration, tags, mob effects |
| Server | server_scripts/ | Server / integrated server | Recipes, commands, events, scoreboard, loot |
| Client | client_scripts/ | Client | HUD, keybinds, client↔server networking |
Reloading
Run /atomicoffe reload in-game to re-execute server scripts without restarting. Client scripts reload with F3+T.
Global Symbols
Every phase has access to these globals:
| Symbol | Description |
|---|---|
onEvent(id, fn) | Register a Lua callback for a named event |
print(...) | Log values to the mod logger |
logger | Structured logger table (info, warn, error) |
Available APIs by Phase
Startup Phase
Tags— Add, replace, or remove data-pack tag entriesMobEffectRegistry— Register custom status effects (viamob_effect.registryevent)
Server Phase
server— Broadcast messages, manage players, change difficulty/weatherworld— Place/read blocks, spawn entities, particles, explosionscommand— Register custom slash commandsschedule— Run Lua functions after N ticks or on a repeating intervalnetwork— Send/receive custom packets between server and clientsscoreboard— Read and write scoreboard objectivesdata— Persistent per-player key/value storageconfig— Persistent mod configuration (JSON-backed)loot— Add or remove loot table entries- Recipes — Add/remove crafting, smelting, and stonecutting recipes via the
recipesevent (seeRecipes)
Client Phase
client— HUD rendering, keybinds, chat messages, client networking