[PR #326] [MERGED] Mods design: Horizon's Rust mod system and what carries over from Java mods #2494

Closed
opened 2026-11-02 15:56:39 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/326
Author: @ludovic111
Created: 10/15/2026
Status: ✅ Merged
Merged: 10/15/2026
Merged by: @ludovic111

Base: main ← Head: docs/mods-design


📝 Commits (1)

  • 90edb02 Mods design: Horizon's Rust mod system and what carries over from Java mods

📊 Changes

3 files changed (+510 additions, -0 deletions)

View changed files

📝 docs/README.md (+1 -0)
➕ docs/mods.md (+326 -0)
➕ docs/research/java-mod-compat.md (+183 -0)

📄 Description

What

The design for Horizon mods, before the code:

  • docs/mods.md: a Rust mod system on sandboxed WebAssembly components (wasmtime 36 LTS, component model, WIT contract). Capabilities = WIT imports, checked against the component and shown to the player; hooks on request (tick, frame, chat, commands); retained HUD panels; fuel and memory limits, a crashing mod stopped alone; versioning (horizon:mods@0.1.x), hot reload, multiplayer (client / server / both), distribution (.hmod, SHA-256, minisign signatures, Modrinth loader or a Git index, launcher Mods tab, CLI/MCP), authoring (horizon-mod-sdk, cargo horizon-mod new/build/run), the planned interfaces and the roadmap.
  • docs/research/java-mod-compat.md: how Fabric/NeoForge mods work (Mixin, Fabric API, NeoForge events), why a JVM bridge cannot run them (no vanilla classes to mix into, mods call vanilla directly, JVM cost, no sandbox), what we do instead (data packs and the data/assets of mod jars, native ports ranked: Mod Menu, AppleSkin, Jade, JEI/EMI, minimap/world map, Litematica...), a Fabric → Horizon porting guide outline.

Why

Ludovic: "add mod compatibility and a new way to make mods for Rust". No promise that Fabric jars run as-is; this doc says why and what replaces it.

Measurements in the doc

From the foundation PRs (stacked after this one), Mac mini M4 Pro, release: empty hook call 85 ns, coords-hud's tick 2.3 µs, no mods 1.2 ns, load 50 ms; in-game median frame 2.62-2.71 ms without mods vs 2.72-2.78 ms with coords-hud (within run-to-run spread).

Needs Ludovic

  • Where mods are listed: ask Modrinth for a horizon loader, and/or a Git-hosted index (no server of ours). Publishing horizon-mod-sdk / cargo-horizon-mod on crates.io (today: git dependency).

Docs only.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/326 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/15/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `docs/mods-design` --- ### 📝 Commits (1) - [`90edb02`](https://github.com/horizon-rust/horizon/commit/90edb028bf4a75790b9b8483e20064e47e6ed333) Mods design: Horizon's Rust mod system and what carries over from Java mods ### 📊 Changes **3 files changed** (+510 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `docs/README.md` (+1 -0) ➕ `docs/mods.md` (+326 -0) ➕ `docs/research/java-mod-compat.md` (+183 -0) </details> ### 📄 Description ## What The design for Horizon mods, before the code: - `docs/mods.md`: a Rust mod system on sandboxed WebAssembly components (wasmtime 36 LTS, component model, WIT contract). Capabilities = WIT imports, checked against the component and shown to the player; hooks on request (tick, frame, chat, commands); retained HUD panels; fuel and memory limits, a crashing mod stopped alone; versioning (`horizon:mods@0.1.x`), hot reload, multiplayer (client / server / both), distribution (`.hmod`, SHA-256, minisign signatures, Modrinth loader or a Git index, launcher Mods tab, CLI/MCP), authoring (`horizon-mod-sdk`, `cargo horizon-mod new/build/run`), the planned interfaces and the roadmap. - `docs/research/java-mod-compat.md`: how Fabric/NeoForge mods work (Mixin, Fabric API, NeoForge events), why a JVM bridge cannot run them (no vanilla classes to mix into, mods call vanilla directly, JVM cost, no sandbox), what we do instead (data packs and the data/assets of mod jars, native ports ranked: Mod Menu, AppleSkin, Jade, JEI/EMI, minimap/world map, Litematica...), a Fabric → Horizon porting guide outline. ## Why Ludovic: "add mod compatibility and a new way to make mods for Rust". No promise that Fabric jars run as-is; this doc says why and what replaces it. ## Measurements in the doc From the foundation PRs (stacked after this one), Mac mini M4 Pro, release: empty hook call 85 ns, coords-hud's tick 2.3 µs, no mods 1.2 ns, load 50 ms; in-game median frame 2.62-2.71 ms without mods vs 2.72-2.78 ms with coords-hud (within run-to-run spread). ## Needs Ludovic - Where mods are listed: ask Modrinth for a `horizon` loader, and/or a Git-hosted index (no server of ours). Publishing `horizon-mod-sdk` / `cargo-horizon-mod` on crates.io (today: git dependency). Docs only. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 15:56:40 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#2494
No description provided.