Skip to main content

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/:

PhaseDirectoryRuns OnUse For
Startupstartup_scripts/Mod initItem/block registration, tags, mob effects
Serverserver_scripts/Server / integrated serverRecipes, commands, events, scoreboard, loot
Clientclient_scripts/ClientHUD, 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:

SymbolDescription
onEvent(id, fn)Register a Lua callback for a named event
print(...)Log values to the mod logger
loggerStructured logger table (info, warn, error)

Available APIs by Phase

Startup Phase

  • Tags — Add, replace, or remove data-pack tag entries
  • MobEffectRegistry — Register custom status effects (via mob_effect.registry event)

Server Phase

  • server — Broadcast messages, manage players, change difficulty/weather
  • world — Place/read blocks, spawn entities, particles, explosions
  • command — Register custom slash commands
  • schedule — Run Lua functions after N ticks or on a repeating interval
  • network — Send/receive custom packets between server and clients
  • scoreboard — Read and write scoreboard objectives
  • data — Persistent per-player key/value storage
  • config — Persistent mod configuration (JSON-backed)
  • loot — Add or remove loot table entries
  • Recipes — Add/remove crafting, smelting, and stonecutting recipes via the recipes event (see Recipes)

Client Phase

  • client — HUD rendering, keybinds, chat messages, client networking