For agents
Rules for a coding agent making a Horizon mod. They are short on purpose; each links to its page.
From the modding book of arismoko/horizonbfbda6a
- Choose the shape. A content mod has no
Cargo.toml. A code mod hasCargo.tomlandsrc/at the top and implementsHookswith#[mod_api::horizon_mod]. Never write raw injections first. - Use a hook or a Part method when one exists (search the rustdoc of
horizon-mod-api). A per-block, per-item or per-entity moment is a Part method (Parts). - Otherwise follow the injection ladder: an API
[[inject]]declaration naming a crate-root function and itsmod_pointsrecord; useaccess = "internals"and declared internals only when the API cannot express it. Every injection comes with a hook request. Injects never compile game code; missing slots are refused on both targets. Use a mixin for supported native source edits, or request a slot. - Names: NeoForge 26.3 names for hooks that have a counterpart; no
on_prefix; the event is&mut; handles come from the event; writes takehost. - Layout:
horizon-mod.toml,assets/,data/,Cargo.tomlandsrc/at the top. The id and version come only fromhorizon-mod.toml; ids are[a-z0-9_]. Nonative/folder, nohorizon-native.json. - Manifest fields:
id,name,version,description,authors,api = "0.2",side,capabilities = ["registries"],[dependencies], top-levelinternals,[[inject]],[native](game,horizon,mixins, optionalmixin,bridge,state,module) or[wasm],[[jar]]. One of[native]or[wasm], never both. Unknown fields are refused (manifest). - Freshness errors: a changed function hash or call context refuses the injection; use
inject updateor reselect it withinject add. Never substitute a different call. - Data and assets are read through a reload hook, once per reload, never on the tick.
- Missing hook? File a hook request on arismoko/horizon.
Edit this page on GitHub · Spotted something wrong? Open an issue .