Pick a runtime
Every mod uses the same API: the events, host functions, registries and permissions in seer_api/api.ron (see the API reference). The runtime only decides how your code reaches it.
| Runtime | You write | The package carries | Sandboxed |
|---|---|---|---|
native (Rust) | the seer crate: #[seer::mod_main], #[seer::event], ModInit | .dll / .so / .dylib per platform | no |
native (C) | seer.h: seer_mod_entry + the SeerHostApi table | .dll / .so / .dylib per platform | no |
lua | Luau: the seer global, seer.on(..) | main.lua / main.luau | yes |
wasm | a core wasm module importing "seer" (seer_guest.rs for Rust) | mod.wasm | yes |
Lua and WASM mods run in plugins that ship next to the game (seer_script_lua.dll, seer_script_wasm.dll) and are loaded only when a mod needs them. They are held to their permissions and cannot listen to events that fire off the render thread. Native mods can use everything, and are not sandboxed.
1. Install the tools
Install only what your runtime needs. A Lua mod needs Python and an editor, nothing else.
The seer CLI is a Python script with no packages to install. Tick "Add python.exe to PATH" and keep the py launcher.
Any recent stable toolchain: mods talk to the game through a C ABI, so the compiler version does not have to match the game. On Windows use the MSVC host (x86_64-pc-windows-msvc). WASM mods also need the wasm32-unknown-unknown target.
Workload "Desktop development with C++": the MSVC linker rustc uses for a .dll.
seer build compiles C mods with zig cc, for every target from one machine.
rust-analyzer for Rust, Luau LSP or the Lua extension (sumneko.lua) for Lua mods with seer_api/lua/seer.d.luau.
rustup default stable
rustup target add wasm32-unknown-unknown # WASM mods only
rustc -vV # host: x86_64-pc-windows-msvc on Windows2. Download and unzip
The downloads are at the bottom of the page: seer-sdk-windows-x86_64.zip (the crates, headers, type definitions and api.ron), seer-cli.zip (the seer command) and example-mods.zip. Unzip all three into the same folder. They share one layout, and the CLI and the examples find the SDK relative to themselves.
:: unzip seer-sdk-windows-x86_64.zip, seer-cli.zip and example-mods.zip into C:\seer
setx PATH "%PATH%;C:\seer\tools\seer"
:: open a new terminal, then:
seer --helpC:\seer\
seer-sdk\seer\ seer-macros\ seer-sys\ the Rust SDK crates
seer-sdk\examples\hello\ hello-lua\ hello-wasm\
seer-script-lua\examples\hello\ a Lua mod that uses require()
seer_api\api.ron THE API definition
seer_api\include\seer.h C header
seer_api\lua\seer.d.luau Lua types
seer_api\wasm\seer_guest.rs seer_api\wit\ WASM bindings
seer_api\docs\index.html API reference (offline)
tools\seer\ the seer CLINo PATH change? py C:\seer\tools\seer\seer.py ... works everywhere seer ... does. Exit code 0 is success, 1 means errors were found, 2 is a usage error.
3. Build the examples
The three examples are the same mod (an FPS HUD line, a /hello command, a tooltip line on diamonds and a chat spam filter) written for each runtime. Each folder has a README.
cd C:\seer\seer-sdk\examples\hello
seer pack :: cargo build --release --target x86_64-pc-windows-msvc, check, pack
:: -> build\hello-0.1.0.seerm
cd ..\hello-lua
seer pack :: nothing to build -> build\hello_lua-0.1.0.seerm
cd ..\hello-wasm
seer pack :: cargo build --release --target wasm32-unknown-unknown -> mod.wasm
:: -> build\hello_wasm-0.1.0.seermInstall a package by copying it into the mods folder, then start the client:
copy build\hello-0.1.0.seerm "%APPDATA%\.seerclient\mods\"4. Create a project: seer new
cd C:\seer\mods-dev :: anywhere outside C:\seer\seer-sdk
seer new my_mod :: native Rust (the default)
seer new my_mod --lang c :: native C
seer new my_mod --lang lua
seer new my_mod --lang wasm :: Rust compiled to a core wasm module
:: options: --dir D --name "My Mod" --force| --lang | You get |
|---|---|
rust | Cargo.toml (cdylib + rlib, seer = { path = "C:/seer/seer-sdk/seer" }), src/lib.rs with a HUD layer, a command and an ItemTooltip listener |
c | src/mod.c: seer_mod_entry registering an ItemTooltip listener (include dir seer_api/include) |
lua | main.luau with one seer.on("ItemTooltip", ..) listener; "file": "main.luau" |
wasm | Cargo.toml (cdylib, its own [workspace]), .cargo/config.toml (wasm32 target), src/lib.rs = the hello-wasm example, src/seer_guest.rs; "file": "mod.wasm" |
Every scaffold also has seer.mod.json (with "seer_api": {"version": "1.1"}) and a .gitignore, and passes seer check. The id is lowercase letters, digits, _ and -.
5. The manifest: seer.mod.json
A manifest is a Seer mod when it has a "seer_api" block.
{
"schemaVersion": 1,
"id": "my_mod",
"version": "0.1.0",
"name": "My Mod",
"description": "What it does.",
"authors": ["you"],
"license": "MIT",
"environment": "client",
"runtime": "native",
"seer_api": { "version": "1.1" },
"permissions": ["chat.send"],
"bin": { "x86_64-pc-windows-msvc": "bin/x86_64-pc-windows-msvc/my_mod.dll" }
}| Field | Meaning |
|---|---|
schemaVersion | Must be 1. |
id | Lowercase letters, digits, _ and -. Also the folder name of the mod's data: <game dir>/config/<id>/. |
version | Semantic version; seer pack names the package <id>-<version>.seerm. |
name, description, authors, license, icon | Metadata shown in the mod list and the library. |
environment | "client" (or "*"). A server-only mod is skipped. |
runtime | "native" (default), "lua" or "wasm". |
seer_api.version | The API MAJOR.MINOR the mod is built against. The game refuses a different MAJOR or a newer MINOR. Current: 1.1. |
permissions | chat.send, network.http, fs.config, screen.open, input.override, render.offscreen, clipboard. An unknown name refuses the mod. |
bin | Native only: target triple to the library in the package. seer build fills it in. |
file | Lua / WASM: the entry file (default main.luau, or mod.wasm). |
after | Ids of mods to load before this one. |
limits | Lua / WASM: { "timeout_ms": .., "memory_mb": .. } per callback / per instance. |
depends, breaks | Fabric-style version predicates on other mod ids (minecraft, seer, any mod), checked at launch. |
Paths the manifest names (bin, file) must stay inside the mod: relative, no .., no drive letter.
6. Native Rust
#[seer::mod_main] marks the init function and writes the seer_mod_entry export; it finds every #[seer::event] function in src/ itself. An event's wrapper is named like the event (ItemTooltip); a two-part name can be written ChatReceive::Allow, ClientTick::End. A listener returns (), a Flow or a bool (false cancels), and takes priority = LOWEST | LOW | NORMAL | HIGH | HIGHEST | MONITOR and receive_cancelled = true.
use seer::prelude::*;
#[seer::mod_main(id = "my_mod", name = "My Mod")]
fn init(m: &mut ModInit) {
m.hud_layer("my_mod:fps", HudAnchor::After(Vanilla::Hotbar), |g, ctx| {
g.text(&format!("FPS {}", ctx.fps()), 4, 4, 0xFFFFFF);
});
m.command("my_mod", |cmd| cmd.executes(|c| { c.feedback("Hi!"); Ok(()) }));
}
#[seer::event(ItemTooltip)]
fn tooltip(e: &mut ItemTooltip) {
if e.stack().is(items::DIAMOND) { e.lines().push(text!("Shiny" gold)); }
}
#[seer::event(ChatReceive::Allow, priority = HIGH)]
fn filter(e: &mut ChatReceive) -> Flow {
if e.plain().contains("spam") { Flow::Cancel } else { Flow::Continue }
}ModInit also has keybind, block, item, block_entity_type, entity_type, menu_type, registry_entry and data_component; the modules seer::widgets, seer::world (server address, dimension, the mod's data files), seer::model (entity model parts) and seer::content cover the rest, and seer::sys is the raw host table for everything else. Release builds keep panic = "unwind": the SDK catches a panic in a listener and the game drops that mod's listeners instead of crashing.
7. Native C
Include seer_api/include/seer.h, export seer_mod_entry and return SEER_API_VERSION. Before calling a host function added after 1.0, check it with SEER_HAS(host, fn). seer build uses zig cc for every target.
#include "seer.h"
static SeerFlow on_tooltip(void *user, void *args) {
SeerItemTooltipArgs *a = (SeerItemTooltipArgs *)args;
(void)user; (void)a;
return SEER_FLOW_CONTINUE;
}
__declspec(dllexport)
uint32_t seer_mod_entry(const SeerHostApi *host, const SeerModInit *init) {
host->register_listener(init->mod_handle, SEER_EV_ITEM_TOOLTIP, SEER_EV_ITEM_TOOLTIP_HASH,
SEER_PRIORITY_NORMAL, 0, 0, 0, on_tooltip, 0);
return SEER_API_VERSION; /* 0 = init failed */
}8. Lua
Every host function is seer.<name> (and seer.<first>.<rest>, so seer.chat.send is seer.chat_send). Event fields have their api.ron names; struct fields are flattened (e["pos.x"]); writing out on an override event marks it set. seer.log/warn/error, seer.has_permission, seer.config.read/write (with fs.config) and require("a.b") (inside the mod folder only) are built in.
local DIAMOND = seer.registry_id(1 --[[Item]], "minecraft:diamond")
seer.hud_layer_register("my_mod:fps", 3 --[[AFTER]], "minecraft:hotbar", function(gui, hud)
seer.gui_text(gui, "FPS " .. seer.fps(), 4, 4, 0xFFFFFFFF, true)
end)
seer.command_register("my_mod", function(ctx) seer.command_feedback("Hi!"); return 1 end)
seer.on("ItemTooltip", function(e)
if seer.stack_item_id(e.stack) == DIAMOND then e.lines:push("Shiny") end
end)
seer.on("ChatReceiveAllow", function(e)
if string.find(e.plain, "spam", 1, true) then return seer.CANCEL end
end, { priority = seer.PRIORITY.HIGH })9. WASM
The runtime loads a core module (wasm32-unknown-unknown) that imports module "seer" and exports memory, seer_init() -> i32 (0 = success) and seer_dispatch(callback, user) -> i32. You choose a callback number for every listener, HUD layer and command; the host calls seer_dispatch with it. Host functions go through seer::call(seer::fn_id(seer::fns::GUI_TEXT), args, n, out) with Value arguments. For Rust, seer_api/wasm/seer_guest.rs is the binding (seer new --lang wasm copies it in).
#[no_mangle]
pub extern "C" fn seer_init() -> i32 { // once; register everything here
unsafe {
let name = seer::events::ITEM_TOOLTIP; // "ItemTooltip"
let ev = seer::event_id(name.as_ptr(), name.len() as i32);
F_LINES = seer::field_index(ev, "lines".as_ptr(), 5);
seer::on(ev, CB_TOOLTIP, 0, 0, 0); // event, callback number, user, priority, flags
}
0
}
#[no_mangle]
pub extern "C" fn seer_dispatch(callback: i32, _user: i32) -> i32 {
match callback {
CB_TOOLTIP => { /* seer::lines_insert(F_LINES, ..) */ 0 }
_ => 0, // 1 cancels a cancellable event
}
}10. Check, build and pack
seer check # manifest, API version, every event name, permissions vs host fns used
seer check --strict # warnings are errors
seer build # native: for this machine; --target all | windows-x86_64 | linux-x86_64 | ...
seer pack # build, check, write build\<id>-<version>.seerm and print its sha256
seer pack --split --target all # one .seerm per platform
seer verify build\my_mod-0.1.0.seermseer packbuilds for this machine first (Lua: nothing to build), stops on check errors unless you pass--force, and packsseer.mod.json, the binaries inbinor the script / module,assets/,data/,scripts/,icon.png,LICENSEandREADME.md, plus a SHA-256 integrity manifest.- Your
assets/anddata/load as a hidden built-in resource pack: models, textures, lang files and sounds for the blocks, items and sounds you register. - Cross targets: Linux from Windows uses
cargo zigbuild, Windows from elsewherecargo xwin. Android and iOS link the mod into the game:seer build --target android-arm64 --builtin <RustSrc>.
11. Run it in the game
seer config game "C:\path\to\seer.exe" # once; stored in %APPDATA%\seer\config.json
seer dev # build, start the game with this folder as a dev mod, rebuild on save:
# native mods are reloaded in place, Lua / WASM by their plugin
seer run # pack, then start the game with MCRUST_ADD_MODS=<the .seerm>
seer run --folder # load the project folder itself, no pack
seer run --dry-run # print the environment and command line only
seer run -- --gameDir C:\seer-dev # everything after -- goes to the gamePoint seer config game (or --game, or SEER_GAME) at the client's executable. Neither command copies anything into your mods folder.
12. Debugging
- A mod that does not load is reported in the game's log as
[SeerClient] mod not loaded: mod `id` (folder): reason; the game keeps running without it. - Your own lines:
seer::info!/warn!/error!,seer.login Lua, theloghost function in C and WASM. Each line carries the mod id. Log once per kind of event, never per frame. - A listener that never runs: check the name with
seer check, the thread (scripts cannot listen toNet/Anyevents), the filter ids, and whether an earlier listener cancelled the event. - A registration that answers -5 (FROZEN) came after the mod's init: register HUD layers, commands, key bindings, screens and content in init.
- Lua / WASM watchdog: a callback that runs past
limits.timeout_msis stopped and the error is logged.
Common errors
built for Seer API 1.0; this game speaks 2.0 (major differs - rebuild the mod)
The API MAJOR changed: rebuild against the new SDK. "this game is older (..) - update the game" is the opposite case: the mod asks for a newer MINOR than the client has.
layout hash ... differs from the game's ... at the same API version
The mod was built against a different seer-sys than the game at the same version number. Rebuild it against the SDK of this release.
no binary for this platform (x86_64-pc-windows-msvc) in "bin"
seer build for that target, then pack again; seer check warns about every bin entry that is not built.
no `seer_mod_entry` export - not a Seer event-API mod
A Rust mod needs #[seer::mod_main] on its init function; a C mod must export seer_mod_entry (__declspec(dllexport) on Windows).
seer check: no event `ItemTooltips` in the API definition (did you mean ...)
A typo, or an event this API version does not have. The API reference lists every event and its arguments.
uses `chat_send` which needs permission `chat.send`
Add the permission to "permissions" in seer.mod.json. Script mods are refused the call without it.
the package was modified after it was packed; refusing it
An entry no longer matches META-INF/seer.sha256. Never edit a .seerm in place: repack with seer pack.