Files
horizon-mods/native/fps-overlay
Ludovic MarieandClaude Opus 5.5 876f7d1dc7 Native mods: one folder each in native/, shared tools and CI
Horizon's own native mods (zoom, fps-overlay, keystrokes, minimap) were one
repo each; they now live here under native/<name>/ with their history.
native/tools/native.py builds, packages and proves any of them, alone or
together; native.yml checks each changed folder (fmt, clippy, tests, the
.hnmod, the game with it applied), every mod together, and every Monday all
of them on the newest Nightly. Pinned to Horizon 1149c92 (hook points v1).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 20:59:14 +01:00
..

FPS Counter (Horizon native mod)

Horizon's official FPS counter: frames per second in a box in a corner of the screen, and, if you like, the slowest frame and the 1% low of the last 5 seconds. Its settings page (Options > Mods > FPS Counter > Settings) picks the corner and the lows.

It is a horizon-mixins bundle (mixins/fps_overlay/) that the Horizon launcher builds into the game. It replaces the WebAssembly FPS Counter 1.x and keeps its settings: the same files (horizon-mods/.horizon-mod-data/fps_overlay/corner, lows).

Install

In the Horizon launcher: Mods → FPS Counter → Install, then Settings → Game → Native mods (experimental) → Build. The launcher downloads its own Rust and builds the game with your native mods; see Horizon's native mods.

Made on the hook points

The bundle hooks only Horizon's native hook points (crates/horizon-client/src/game/native_hooks.rs), which keep their names and signatures across releases. compatibility.json names the version it needs ("hooks": 1), so the launcher builds FPS Counter on any Horizon with that version or a later one, the player's own game by default, together with any other mod. horizon_revision is only the commit it was last tested on.

File What it is
mixins/fps_overlay/horizon-mixin.toml The bundle: one module and the HEAD hooks
mixins/fps_overlay/runtime.rs The mod's logic and state, added to the game as game::official_fps_overlay; also this crate's library, for its tests
mixins/fps_overlay/*.rs One small helper per hook
../tools/native.py Shared by the native mods: apply on Horizon (from GitHub, by commit), check, build, package the .hnmod, run the proof
proof.py (with ../tools/game.py) The proof: the built game driven with horizon-ctl --offscreen on fresh, temporary data

Build and prove

(cd native/fps-overlay && cargo test)                    # the logic
python3 native/tools/native.py check fps-overlay   # apply on the tested Horizon and cargo check the game
python3 native/tools/native.py check fps-overlay --horizon latest  # ... on the newest Nightly
python3 native/tools/native.py check all           # with the other native mods, as a player's set
python3 native/tools/native.py package fps-overlay # native/target/fps_overlay-<version>.hnmod for the registry
python3 native/tools/native.py proof fps-overlay --resources /path/to/.local/horizon-client/26.3

The proof needs resources prepared from your own Minecraft 26.3 (horizon-prepare); none are in this repository. It seeds the WebAssembly mod's settings (bottom right, lows on) in a temporary game folder, then checks that Options > Mods shows them, and that the Corner button moves the box to the top left and writes the same file. CI runs cargo test, packages the .hnmod and checks the game on the tested commit, and every Monday on the newest Nightly.

License: MIT.