mirror of
https://github.com/horizon-rust/horizon.git
synced 2026-12-03 20:54:04 +07:00
[GH-ISSUE #7386] Native mod API: a path to large mods without mixins or game rebuilds #3221
Open
opened 2026-11-03 04:06:47 +07:00 by bsakaguchi
·
11 comments
No Branch/Tag specified
main
layers/tab-mark
layers/render-telemetry
automation/native-hook-stamp
layers/plan
bench/smp-perf-union3
bench/smp-perf-union2
perf/hopper-cart-item-columns
perf/guest-pickup-columns
perf/hopper-container-entity-columns
bench/smp-perf-union
perf/spawner-player-scans
perf/ticking-chunk-neighbours
pr-screenshots
nightly-state
nightly/build-2026-11-08-1
nightly/build-2026-11-08-2
agent/native-prebuilt-install
feat/shop-fortnite
agent/native-prebuilt-export
ci/runner-gc-busy-versioned-bin
nightly/build-2026-11-07-2
agent/cg69-11273-after-11457
nightly/build-2026-11-07-1
fix/storage-is-multiple-of
perf/name-tag-layout-cache-from-10328
perf/zlib-level-2
deploy/smp-profile
pvp/hud-layout
fix/launcher-uninstall-window
nightly/build-2026-11-05-3
nightly/build-2026-11-05-2
nightly/build-2026-11-05-1
fix/9382-review-fixes
deploy/r9-1-moderation
deploy/rtp1-8669
bench/site-2026-11-04
nightly/build-2026-11-04-3
screenshots/launcher-dezer
nightly/build-2026-11-04-2
dezer/partner
perf/spawn-start-palette
agent/rdbtcvs/server-preload-existing-world
agent/rdbtcvs/server-no-mesh-tables
screenshots/launcher-redesign-5
deploy/r8-1-slowtick-culprit
fix/8570-font-fishy-any
screenshots/lr6-audit
lr6/instance-defaults
nightly/build-2026-11-04-1
nightly/build-2026-11-03-3
nightly/build-2026-11-03-2
bench/stps1-diag
hotfix/r6-1-station-crash
bench/stps1-cart
perf/still-cart-collisions
fix/launcher-ko-hr-wardrobe
screenshots/launcher-redesign-4
perf/vulkan-pipeline-cache
perf/dx12-fxc-measure
perf/teleport-forget
perf/prebuild-lazy-pipelines
perf/mesh-view-first
perf/sync-data-once
perf/entity-skin-eyes
perf-jobs/pool
perf/gpu-solid-draws
perf/gpu-solid-lists
perf/upload-budget-follows-frame
perf/surface-rules-by-biome
perf/section-instances-once
nightly/build-2026-11-01-5
nightly/build-2026-11-03-1
bench/sp3-int
perf/cart-collisions-near
sweep-l/5696
sweep-l/5645
sweep-l/5644
sweep-l/5643
nightly/build-2026-11-01-4
bench/sp2-tags
mod-api-rework
bench/sp2-ovl-b
perf/world-prepare-overlap-b
nightly/build-2026-11-01-3
sweep-l/5513
sweep-l/5598
sweep-g/remerge-5696
sweep-g/remerge-5693
sweep-g/remerge-5645
sweep-g/remerge-5644
sweep-g/remerge-5643
nightly/build-2026-11-01-2
bench/sp2-prepare-times
nightly/build-2026-11-01-1
bench/sp2-props-count
bench/sp2-start-stages
perf/mimalloc-lazy-arena-commit
bench/sp2-lant
bench/sp2-lanb
bench/sp2-emk
perf/entity-models-wanted-keys
bench/sp2-mem-loaders
bench/sp2-mem-stages
bench/sp2-lan-spans
bench/sp2-stream-spans
fix/5326-remove-native-build
perf/decoration-order-lookups
perf/dedicated-world-preload
bench/sp2-rt-span
launcher-gpui-fast
bench/sp2-purge-env
feat/native-nicknames-stamped
perf/random-tick-reads-first
a3/fix-perf-bench-test
agent/finish-4958
hotfix/attack-arm
a2/fix-hub-attack
fix/audio-share-fields
feat/native-sidebar-stamped
perf/attr-ids
perf/mobs-move-back
bench/sp1-f5
bench/sp1-f4
bench/sp1-all
bench/sp1-f3
bench/sp1-f2
bench/sp1-f1
perf/net-events-list
fix/join-message-order
feat/smp-grief-hooks
feat/anticheat-speed
fix/server-floating-kick
bench/st2-f1
perf/spawn-placement-first
tools/bots-server-mix
tools/bots-view-time
debug/light-edge-4294
w5/data-file
perf/collision-shapes-w4
bench/sn-abuse
bench/sn-w4-scratch
bench/sn-w4-ladder
fix/remote-thrown-egg
union/pt3-w2
union/pt2-e3
union/wasm-removal
union/pt2-e2
union/pt2-e
union/pt2-c2
union/pt3-w1
triage/pt3-3106-check
union/pt2-c
union/pt3-5
triage/pt3-bisect-rest
triage/pt3-bisect-2608
triage/pt3-2960
ci/parity-incremental
union/pt3-4
union/pt3-3
union/pt2-a
union/pt1-wave1
triage/pt3-2608
union/pt3-2
triage/pt3-2586
triage/pt3-2544
launcher-java-inherits-abca441
launcher-java-play-99b52c2
launcher-native-auto-8ea9a2c
union/pt3-1
launcher-native-auto-f220157
union/cg29-2
union/cg29-1
launcher-delete-instance-cbacada
union/cg28-1
union/cg27-3
union/cg27-2
union/cg27-1
union/cs2-b9v2-3403
union/cs2-b9v2-2888
union/cs2-b9v2-3455
union/cs2-b9v2-text
launcher-java-command-c5221cc
launcher-java-command-266c457
launcher-join-40073ab
union/cs2-b9-2888
union/cs2-b9-e
union/cs2-b9-a
union/cs2-b9-c
launcher-java-command-a7841cc
launcher-any-version-e470f3a
launcher-java-instances-2034db1
launcher-any-version-d4120a9
launcher-any-version-795a0db
launcher-java-test-windows-75b8a17
union/cs1-b9-3048
union/cg24-u1
feat/mod-shaders-game
feat/mod-shader-check
feat/mod-storage-quota
union/cg19-r5
screenshots/nightly-1
union/cg19-r4
union/cg19-r3
union/cg19-r2
union/cg21-kacpherek-2
union/cg19-r1b
carry/2592-headless-capture
union/cg19-r1
screenshots/sculk-sidebar-2
fix/entity-nbt-duplicate-rabbit
union/cg19-a3
union/cg19-a2
cg19/union-bc
union/cg19-bc
cg21/union
union/cg21-kacpherek
feat/mods-lua
cg20/union-c
union/cg19-a
cg20/fusseltv-followups
cg20/union
screenshots/launcher-features
feat/launcher-packs
integ/cg17-w4
chore/site-redeploy-workflow
feat/sculk-banner
ci/playhorizon-parity-trial
feat/world-post-chain-hook
ci/desktop-parity-trial-3
ci/desktop-parity-trial-2
ci/desktop-parity-trial
perf/packed-storage-no-div
feat/native-shaders-sdk
pr-evidence/remove-shader-packs
pa1/remove-dh-mixins
fix/st-border
screenshots/reports-gate-2
perf/metal-occlusion-cull
fix/macos-uncapped-redraw
screenshots/perf-rd32-1190
perf/visible-bucket-sort
screenshots/shaders-1
perf/screen-overlay-wrap
screenshots/menus-vanilla
screenshots/design-gaming-website
screenshots/design-gaming
feat/horizon-shaders-rust
feat/horizon-shaders-v1
feat/shader-pack-options
perf/metal-multi-draw
perf/random-tick-reads
screenshots/update-channels
screenshots/f2b-resource-packs
integ/w2
screenshots/f2a-resource-packs
feat/codemods-1
screenshots/live-count
perf/random-tick-batches
feat/raytracing-spike
screenshots/platform-batch
integ/w1
fix/main-moving-block-tint
screenshots/f3-dynamic-lights
screenshots/f1-shaders
docs/perf-comparison-v2
screenshots/q2-parity-entities-audio
screenshots/q1-parity-ui
screenshots/p4-worldgen-chunks
screenshots/b2-rendering
screenshots/perf-frame-cost
feat/companion-safety
feat/companion-polish2
feat/companion-route
feat/companion-nether
integ/contrib-10-21
feat/companion-planner
feat/companion-end
feat/companion-polish
feat/companion-integ
feat/companion-voices
feat/companion-engine
feat/companion-skills
feat/companion-body
feat/companion-brain
feat/companion-senses
feat/companion
screenshots/launcher-servers
perf/lod-side-faces
perf/section-occlusion-cull
perf/compact-terrain-vertex-20byte
fix/server-thread-default
perf/chunk-occupied-columns
media/modpacks-launcher
fix/server-game-rules-page
review/contrib-review-1-startup-batch
fix/f3-network-counters
fix/clouds-cached-mesh
fix/remesh-tail
feat/vaults
pr-evidence/291
pr-evidence/287
pr-evidence/285
feat/perf-comparison
pr-evidence/238
design-review
fix/particles-63-missing-types
t3/achieve-full-parity
prepare-fix
graphics
launcher-0.1.2
game-bugs
feel
menus
cleanup
launcher
parity/screens
parity/leftovers
parity/server-leftovers
parity/menus-golem
parity/platform-maths
parity/save-roundtrip
parity/old-saves
parity/old-saves-flat
parity/warden-sculk
parity/spawn-gear
parity/rendering-gaps
parity/dedicated-server
parity/villager-social
parity/render-distance
parity/mobs-b
parity/block-followups
parity/mobs-a
parity/score-subtitles
parity/loom-crafter
parity/tablist-border
parity/raids
parity/tooling
parity/rendering-be
parity/hud
parity/entity-ai
parity/rendering-anim
parity/rendering-hud
parity/saves
parity/blocks
parity/loot-spawn
parity/multiplayer
parity/input
parity/assets
ci/ludodesktop-runner
launcher@0.2.56
launcher@0.2.55
launcher@0.2.54
launcher@0.2.53
launcher@0.2.52
launcher@0.2.51
nightly-source/2026-11-08-fdc87ae
nightly
launcher@0.2.50
nightly-2026-11-07
nightly-source/2026-11-07-2ebf00a
nightly-source/2026-11-07-6560641
launcher@0.2.49
launcher@0.2.48
launcher@0.2.47
launcher@0.2.46
launcher@0.2.45
launcher@0.2.44
launcher@0.2.43
nightly-2026-11-05
nightly-source/2026-11-05-66f3981
nightly-source/2026-11-05-38609b7
nightly-source/2026-11-05-f319701
launcher@0.2.42
launcher@0.2.41
launcher@0.2.40
nightly-2026-11-04
nightly-source/2026-11-04-6475f62
nightly-source/2026-11-04-3fb4c31
launcher@0.2.39
launcher@0.2.38
nightly-source/2026-11-04-67dad0d
nightly-2026-11-03
nightly-source/2026-11-03-2944480
nightly-source/2026-11-03-f42ef42
launcher@0.2.37
launcher@0.2.36
launcher@0.2.35
launcher@0.2.34
nightly-2026-11-01
nightly-source/2026-11-01-c9d474d
nightly-source/2026-11-01-4aa6854
nightly-source/2026-11-01-8c02c0b
launcher@0.2.33
nightly-source/2026-11-01-07b7ea3
launcher@0.2.32
nightly-source/2026-10-31-d91cab6
nightly-source/2026-10-31-aa27eca
launcher@0.2.31
nightly-source/2026-10-31-68ac6f6
nightly-source/2026-10-31-9d979ca
nightly-source/2026-10-31-7635280
nightly-source/2026-10-31-7aa0e28
launcher@0.2.30
launcher@0.2.29
nightly-source/2026-10-30-1da354b
nightly-source/2026-10-30-587f81f
nightly-source/2026-10-30-41672b1
nightly-source/2026-10-30-ba6344a
nightly-source/2026-10-30-fbd7288
nightly-source/2026-10-30-a99ef86
nightly-source/2026-10-30-33f417f
nightly-source/2026-10-30-df583d3
nightly-source/2026-10-30-a46ce68
launcher@0.2.28
nightly-source/2026-10-29-a305d38
launcher@0.2.27
nightly-source/2026-10-29-baa379d
nightly-source/2026-10-29-d009ebd
nightly-source/2026-10-29-64e2989
nightly-source/2026-10-29-a491181
launcher@0.2.26
nightly-source/2026-10-29-45ecf7b
launcher@0.2.25
nightly-source/2026-10-29-5e391eb
nightly-source/2026-10-29-4baa571
launcher@0.2.24
launcher@0.2.23
nightly-source/2026-10-28-6f8c7a0
nightly-source/2026-10-28-9669600
launcher@0.2.22
v0.2.97
v0.2.96
v0.2.95
v0.2.94
launcher@0.2.21
v0.2.93
nightly-source/2026-10-28-83f15fa
nightly-source/2026-10-28-9b772b2
launcher@0.2.20
v0.2.92
launcher@0.2.19
launcher@0.2.18
launcher@0.2.17
v0.2.91
v0.2.90
v0.2.89
v0.2.88
v0.2.87
v0.2.86
launcher@0.2.16
v0.2.85
v0.2.84
v0.2.83
v0.2.82
v0.2.81
launcher@0.2.15
v0.2.80
v0.2.79
launcher@0.2.14
v0.2.78
v0.2.77
launcher@0.2.13
v0.2.76
v0.2.75
v0.2.74
launcher@0.2.12
v0.2.73
v0.2.72
v0.2.71
v0.2.70
launcher@0.2.11
v0.2.69
launcher@0.2.10
v0.2.68
v0.2.67
launcher@0.2.9
v0.2.66
v0.2.65
v0.2.64
v0.2.63
v0.2.62
v0.2.61
v0.2.60
v0.2.59
v0.2.58
launcher@0.2.8
v0.2.57
v0.2.56
launcher@0.2.7
v0.2.55
v0.2.54
v0.2.53
v0.2.52
v0.2.51
launcher@0.2.6
v0.2.50
v0.2.49
launcher@0.2.5
v0.2.48
v0.2.47
launcher@0.2.4
v0.2.46
v0.2.45
v0.2.44
v0.2.43
v0.2.42
v0.2.41
v0.2.40
v0.2.39
v0.2.38
v0.2.37
v0.2.36
v0.2.35
v0.2.34
v0.2.33
v0.2.32
v0.2.31
v0.2.30
launcher@0.2.3
v0.2.29
v0.2.28
launcher@0.2.2
v0.2.27
v0.2.26
v0.2.25
v0.2.24
v0.2.23
v0.2.22
v0.2.21
v0.2.20
v0.2.19
v0.2.18
v0.2.17
v0.2.16
v0.2.15
v0.2.14
v0.2.13
v0.2.12
v0.2.11
v0.2.10
v0.2.9
v0.2.8
v0.2.7
v0.2.6
v0.2.5
v0.2.4
launcher@0.2.1
v0.2.3
v0.2.2
v0.2.1
v0.2.0
launcher@0.2.0
v2026.10.23
v2026.10.22.16
v2026.10.22.15
v2026.10.22.14
v2026.10.22.13
v2026.10.22.12
v2026.10.22.11
v2026.10.22.10
v2026.10.22.09
v2026.10.22.08
v2026.10.22.07
v2026.10.22.06
v2026.10.22.05
v2026.10.22.04
v2026.10.22.03
v2026.10.22.02
v2026.10.22.01
v2026.10.22
launcher-v0.17.0
v2026.10.21
v2026.10.19.15
launcher-v0.16.0
launcher-v0.15.0
v2026.10.19.14
v2026.10.19.13
launcher-v0.14.0
launcher-v0.13.0
v2026.10.19.12
v2026.10.19.11
v2026.10.19.10
launcher-v0.12.0
v2026.10.19.09
v2026.10.19.08
v2026.10.19.07
v2026.10.19.06
launcher-v0.11.0
launcher-v0.10.0
v2026.10.19.05
v2026.10.19.04
v2026.10.19.03
v2026.10.19.02
v2026.10.19.01
v2026.10.19
v2026.10.18.27
v2026.10.18.26
launcher-v0.9.0
v2026.10.18.25
v2026.10.18.24
v2026.10.18.23
v2026.10.18.22
v2026.10.18.21
launcher-v0.8.0
v2026.10.18.20
v2026.10.18.19
v2026.10.18.18
launcher-v0.7.1
v2026.10.18.17
v2026.10.18.16
v2026.10.18.15
v2026.10.18.14
launcher-v0.7.0
v2026.10.18.13
v2026.10.18.12
v2026.10.18.11
v2026.10.18.10
v2026.10.18.09
v2026.10.18.08
v2026.10.18.07
launcher-v0.6.0
v2026.10.18.06
v2026.10.18.05
v2026.10.18.04
v2026.10.18.03
v2026.10.18.02
v2026.10.18.01
v2026.10.18
v2026.10.17.25
v2026.10.17.24
v2026.10.17.23
v2026.10.17.22
v2026.10.17.21
v2026.10.17.20
launcher-v0.5.1
v2026.10.17.19
v2026.10.17.18
v2026.10.17.17
v2026.10.17.16
v2026.10.17.15
v2026.10.17.14
launcher-v0.5.0
v2026.10.17.13
v2026.10.17.12
v2026.10.17.11
v2026.10.17.10
v2026.10.17.09
v2026.10.17.08
v2026.10.17.07
v2026.10.17.06
v2026.10.17.05
v2026.10.17.04
v2026.10.17.03
v2026.10.17.02
v2026.10.17.01
v2026.10.17
v2026.10.16.12
v2026.10.16.11
v2026.10.16.10
v2026.10.16.09
v2026.10.16.08
v2026.10.16.07
v2026.10.16.06
v2026.10.16.05
v2026.10.16.04
v2026.10.16.03
v2026.10.16.02
v2026.10.16.01
v2026.10.16
v2026.10.15.22
v2026.10.15.21
v2026.10.15.20
v2026.10.15.19
v2026.10.15.18
v2026.10.15.17
launcher-v0.4.0
v2026.10.15.16
v2026.10.15.15
v2026.10.15.14
v2026.10.15.13
v2026.10.15.12
v2026.10.15.11
v2026.10.15.10
v2026.10.15.9
v2026.10.15.8
v2026.10.15.7
v2026.10.15.6
launcher-v0.3.0
v2026.10.15.5
v2026.10.15.4
v2026.10.15.3
launcher-v0.2.1
v2026.10.15.2
v2026.10.15.1
v2026.10.15
v2026.10.14.5
v2026.10.14.4
v2026.10.14.3
launcher-v0.2.0
v2026.10.14.2
launcher-v0.1.6
launcher-v0.1.5
v2026.10.14.1
v2026.10.14
launcher-v0.1.4
launcher-v0.1.3
v2026.10.13.1
launcher-v0.1.1
v2026.10.13
v2026.10.12
archive/wip-horizon-mobs-split
archive/m2-gaming-optimization
Labels
Clear labels
bug
bug
client
crucial
documentation
duplicate
duplicate
enhancement
enhancement
enhancement
from-discord
from-discord
from-website
good first issue
in progress
launcher
multiplayer
parity
parity-regression
pull-request
Mirrored from GitHub Pull Request
release-blocker
release-now
roadmap:java-instances
roadmap:lean-code
roadmap:modpack-worldgen
roadmap:mods
roadmap:port-ledger
roadmap:server-thread
roadmap:server-tick
roadmap:smooth-frames
server
skip-release
test
No labels
bug
bug
client
crucial
documentation
duplicate
duplicate
enhancement
enhancement
enhancement
from-discord
from-discord
from-website
good first issue
in progress
launcher
multiplayer
parity
parity-regression
pull-request
release-blocker
release-now
roadmap:java-instances
roadmap:lean-code
roadmap:modpack-worldgen
roadmap:mods
roadmap:port-ledger
roadmap:server-thread
roadmap:server-tick
roadmap:smooth-frames
server
skip-release
test
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
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#3221
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @arismoko on GitHub (Nov 2, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7386
Goal: allow large, complex mods without mixins that require a complete recompilation.
This builds on #5109, which first proposed runtime-loaded native plugins. Nothing here changes a hook's meaning, and nothing changes what a game with no mods does. Services are tracked in #7387, hooks in #4953 and the typed API's follow-ups in #6452.
Decisions so far (Nov 2)
The modding team settled these in polls and discussion:
EntityRef,LivingRef,PlayerRef,LevelRef), as vanilla's classes do. #7387 builds them.dylibs, built by the launcher. There is no C ABI and no separate SDK:horizon_client::mod_apiis the API. The launcher keeps the Rust toolchain.The two limits
Hostis a closed façade.Gameis private, and mods reach the game through 113Hostmethods that take IDs and strings. On NeoForge,event.getEntity()hands over the real entity, so the whole object model comes with every event. Here each need is one moreHostmethod, and each missing one sends a modder back to a mixin.The large NeoForge mods show where the gap is. Create's
create.mixins.json(mc1.21.1/dev,4148fd8d5b) lists 65 mixins, and 33 of them are accessors that only read or call private members. Mekanism (1.21.x,bcd7a8bf59) ships no mixins, but its access transformers open 94 private members. Most of what a big mod needs beyond the event bus is the object model, not more events.Four kinds of extension
Hooks)BlockandEntity, capabilities, data attachmentsHostand handles)RegisterEventHandles
EntityRef,LivingRef,PlayerRefandLevelRefcome first, thenBlockEntityRef. They areCopyvalues, and their methods take the host:mob.position(host). A mod can hold two at once, andentities_inreturns a list, so a loop can change the world.NativeWorldEpoch) and the ID. A handle to a dead entity, to one from a closed world, or to a non-player that changed dimension returnsNone. It never causes undefined behaviour.Option, writes returnbool. Event IDs become handles at four constructors:host.entity(id),host.living(..),host.player(uuid)andhost.level(..).Hosthelper innative-hooks.jsongets areceiver, and the generator puts it on that handle.EffectKey,BlockKey...) are resolved once at load. An unknown key fails at load, with the mod and the key named.Hostshrinks. About 90 of today's 113 methods belong somewhere else. Drawing goes to a draw context passed to render and screen hooks. Block, entity and player methods go to handles. Inventory, fluid and energy methods become capability parts. About 20 global services stay onHost: the player list, broadcast, commands, config and settings, mod messages and recipes.Parts
A part is a small piece of behaviour and data attached to a block, item or entity. A mod attaches parts when it loads:
can_survive,state_for_placement,analog_output,block_entity_tick,use_durationand others. Today every mod is asked, and each one checks the ID. A hook'smod_apientry gets ascopeand names the event field that holds the key. The generator emits thePartmethod from it, and dispatch calls only the parts attached to that thing. Hooks about the game in general, such as a player joining or an entity taking damage, stay broadcast events.cancel(the first "no" wins),replace(the first answer wins),collect(all add) andlisten(all hear). Order follows mod dependencies. The same part kind twice on one thing is refused at load, with both mods named. The log names the part that answered.items,fluidsandenergyfrom the game, or a mod's own, such asmekanism:chemicals. The game attaches its own default part over game-owned storage and vanilla containers. A mod adds its own only when it computes the answer: per side, per instance, or from a controller.Cargo.toml. Cargo's semver rules decide what loads together.How mods load
When Horizon updates, the launcher builds the game once, with
horizon-clientas a Rustdylib(-C prefer-dynamic, sostdand the allocator are shared). Each mod then builds as its owndylibagainst that exact build, with the samerustc, profile andCargo.lock. The game loads mods at startup and never unloads them. Rust types cross directly (Box<dyn Hooks>,String,&mut dyn Host, handles), so a trait mod's package stays as it is today.dylibsSo
dylibs pay off in proportion to how few mods use mixins, and the hooks and handles work moves mods into the fast row.serde,wgpu...) must be the game's own build. A crate only the mod uses is compiled into the mod's owndylib.std, and #7227 names the mod and the hook, as it does today.dylibcan't be unloaded soundly, so the development loop is "rebuild the mod, restart the game", not hot reload.dylibbuild.rustcrefuses-C ltofordyliboutputs. Modded builds already useprofile.fast(lto = false). A game with no mods stays the release build, with thin LTO.b09827e934, adylibbuild ofhorizon-clientexports 38,200 symbols withprofile.fast, which fits, and 108,449 with thedevprofile, which doesn't. On Windows,devneeds a higheropt-levelforhorizon-client, or the static build.What this enables later: real mod on/off without a rebuild, switching modpacks on one game build, a safe mode that bisects a crashing mod set, joining a modded server by building only the missing mods, scripting runtimes (Lua, JS, WASM) shipped as ordinary mods, and shipping the game's
dylibbuild prebuilt so that players compile only mods.Plan
Each stage is useful on its own, even if the later ones never land.
Hosthelpers take handles, and own-content hooks get ascope. No new own-content broadcast hooks and no new ID-based helpers until handles and parts land.dylibmods use later.dylibspike on a branch, with the pass mark below written down first. The maintainers judge it before anything changes upstream.dyliband each mod as its own. The game and the dedicated server load them at startup. The static build stays available for a settled mod set.BEFORE_CALL,AFTER_CALL,WRAP_OPERATION,Cancel(value), and trait injections outsidehorizon-client).The spike's pass mark
dylibbuild.profile.fastbuild.zoomand horizon-machine-sample load from theirdylibs with no game rebuild, on the server thread and on a dedicated server. A panic in either names the mod and the hook.If tick time fails, the launcher links a settled mod set statically, as today, and
dylibloading stays the way to add and change mods. If Windows fails, Windows keeps the static build until exports are trimmed.Other surfaces large mods use
NativeScreen, screen hooksregister_commandswith usage stringsconfig_dirhorizon-worldbridgeRenderHooks, block-entity and mob draw listsTrust, versions and parity
revoked.tomland SHA-256 pinning keep working.NATIVE_HOOKS_APIstays: a mod names the API it needs. Across a Minecraft version, a hook whose vanilla call site is gone is retired: it stays in the catalog, warns when compiled and never fires.dylibbuild keeps every firing point, its order and its arguments. Every stage is proven in game, on the server thread, with a no-mod world before and after.Related: #5109 (the origin), #7387, #4953, #6452, #5638, #6216, #6304, #5530, #6302, #6287, #5212, #6300, #6301, #5313, #6768, #3911.
@arismoko commented on GitHub (Nov 2, 2026):
🤖 Agent: The body is edited. The design is the same; it's now shorter, and four points are settled:
horizon-sdkis the only API mod authors write against. A mod links it statically, as today, or builds it as acdylib, from the same source. Today'smod_apibecomes a frozen compatibility layer: it's generated at each dispatch site and hands linked mods the game's own values, so no contract changes. It gets no new hooks and is removed at the first table reset, with notice. Native code is marked experimental indocs/api/mod-files.md. Question 6 now asks when to freeze it.#[horizon_sdk::hooks]on the impl block fills only the table entries the mod wrote. The game keeps the list of mods that implement each hook and skips a hook with none before building its event.cdylibis within 3% of the same source linked statically;ItemStackRefaddresses a stack that moves is now question 7. Stacks go by value until it's settled.@JuanLuci commented on GitHub (Nov 2, 2026):
🤖 Agent (for JuanLuci): a question on mod dependencies, from planning a large port that needs one crate the game doesn't ship: a JS engine, to run Pokémon Showdown for Cobblemon's battles. This isn't a request for a scripting tier. The engine would be a private detail of one mod.
Today a mod's
[[crate]]may only use crates already in Horizon'sCargo.lock(E_CRATE_DEPENDENCY). This design gives eachcdylibits ownstdand allocator and shares only FFI-safe types, so a plugin could seemingly depend on any crate, but the issue doesn't say so.cdylibplugin use crates outside the game's lock?rquickjs) count differently from pure Rust (boa_engine)?@arismoko commented on GitHub (Nov 2, 2026):
🤖 Agent: @JuanLuci, thanks, this is a case the design should answer. Here's what it allows technically. Questions 2 and 3 are policy, so the maintainers decide those; I suggest an option below for each.
Today's rule (
docs/native-mods.md, "The mod's crate"): a mod's crates may use only registry crates already in Horizon'sCargo.lock, in the locked version. "The lock file is the allow list." horizon-mixins refuses anything else withE_CRATE_DEPENDENCY, and the launcher checks again (launcher/src/native_mods/crates.rs). This does two jobs. The game still builds with--locked, and a player's build never downloads a crate Horizon doesn't already ship.1. Can a
cdylibplugin have its own dependencies? Technically, yes. A plugin is its own Cargo build with its ownCargo.lock. Its dependencies are compiled into its own binary, together with its ownstdand allocator. The only thing it shares with the game is the generated C-ABI table. Nothing outside it sees its Rust types, and its symbols aren't exported. Soboa_engineorrquickjsinside a Cobblemon plugin can't clash with the game's versions of anything, and the game's lock never changes. The boundary rules still apply:BoxorStringcrosses the boundary. Results come back as SDK types, written through host callbacks.One limit: the same source can also be linked into the game statically. That route still goes through the game's lock, so a mod with outside dependencies would be
cdylib-only unless the rule changes.2. Registry CI (maintainers' call). One option:
--lockedfrom the mod's committedCargo.lock, using crates.io only, with no git or path dependencies.links/C code flagged.rquickjsneeds a C toolchain for every target the registry builds. Pure Rust likeboa_enginecross-builds more simply.The alternative is a reviewed allow list, which is safer but slower to grow.
3. Until plugins exist (maintainers' call). A crate can only enter Horizon's lock if a workspace member depends on it. Adding
boa_engineorrquickjsfor one mod would mean the game, or a stub member, carries an engine it doesn't use, and every workspace CI build compiles it. I'd expect that to be a no for a single mod. For now I'd suggest prototyping the Showdown bridge as an ordinary crate outside Horizon. Then it moves into the plugin unchanged once stage 4 lands.If the maintainers agree, the issue body can get one line under "Distribution and trust": a plugin builds from its own
Cargo.lock, so for plugins the game's lock stops being the allow list, and which dependencies and build scripts the registry accepts is open.@arismoko commented on GitHub (Nov 2, 2026):
🤖 Agent: The body is edited again. Plugins are now Rust
dylibs on the Rust ABI, notcdylibs behind a generated C table.The model. When Horizon updates, the launcher builds the game once, with
horizon-clientas adyliband-C prefer-dynamic, sostdand the allocator are shared. Each mod then builds as its owndylibagainst that exact build, with the samerustc, profile andCargo.lock. Mods load at startup and are never unloaded. Changing one mod rebuilds only that mod. The launcher rebuilds every mod when the game updates. That is the trade.Why. Rust types cross directly (
Box<dyn Hooks>,String,&mut dyn Host, handles), so a lot of the earlier design goes away:mod_apiadapter: today'sHookstrait and[api]packages simply are the API, and trait mods don't change;Panics unwind through the shared
std, so #7227's attribution works as it does for linked mods. Versioning becomes source-level, with the catalog's append-only rule andNATIVE_HOOKS_APIas they are.What was checked:
rustc1.99.1,-C ltois refused fordyliboutputs, and so is-C prefer-dynamicwith LTO. Builds with mods already useprofile.fast(lto = false), so the comparison that matters is against that build. A game with no mods stays the prebuilt release build, with thin LTO. The spike's pass mark is now tick time within 1% of today's modded build. If it misses, the fallback is linking a settled mod set statically, from the same source.dynamic_linkingbuild unless optimisations are on. On Linux atb09827e934, adylibbuild ofhorizon-clientexports 38,200 symbols withprofile.fast, which fits. With thedevprofile (opt-level = 0) it exports 108,449, which doesn't. So on Windows,devneeds a higheropt-levelor the static build. Windows linking is now part of the pass mark, with static Windows builds as the fallback.Cargo.lockrule stays for shared crates, and features are checked too. A crate only the mod uses goes into the mod's owndylib. Whether such crates may come from outside Horizon's lock is now question 2.dylib, moddylibloaded withdlopen): the mod allocated through the game's allocator, used a crate from the game and a private one, and a panic in the mod was caught by the game.Changed in the plan. The distribution stage is gone, leaving six stages. The spike's pass mark is rewritten. Questions 2 to 4 (table resets, registry signing, macOS signing) gave way to two new ones: the crate rule, and whether to ship the game's
dylibbuild prebuilt. The old question 6 (freezingmod_api) no longer applies.@arismoko commented on GitHub (Nov 2, 2026):
🤖 Agent: @JuanLuci, a correction to my earlier answer. The design has changed (see the edited body): mods are now Rust
dylibs that the launcher builds against adylibbuild of the game, notcdylibs behind a C table. Two things I said no longer hold:std, allocator or copies of the game's crates. It shares all of them with the game. Any crate the game also links (serde,indexmap,hashbrown...) has to be the game's own build: the version in Horizon'sCargo.lock, with the game's features. If a mod changed one, the game would rebuild, or a second copy would come in whose types don't match. So the lock rule stays for shared crates.What still works: a crate only your mod uses, such as
boa_engineorrquickjs, is compiled into your mod's owndylib. That's technically fine, as long as every dependency it shares with the game resolves to the locked version and features. C code builds the way it does for the game's own C crates, with the compiler the launcher already requires. Since the build is on the player's machine, "C or pure Rust" is a review question, not a build one. That's the maintainers' call.This also changes my answer to question 3.
E_CRATE_DEPENDENCYis a policy that horizon-mixins enforces, not a technical limit: a mod's crate is already a workspace member with its own entries in the staged lock. The lever is therefore that rule, not a PR to Horizon's lock. The rule could be relaxed to "new crates are allowed if no locked crate changes", for linked mods today anddylibmods later. That's question 2 in the body, for the maintainers to decide.@arismoko commented on GitHub (Nov 2, 2026):
🤖 Agent: The body is edited to record the modding team's decisions from today. A new Decisions so far section near the top lists them:
dylibs built by the launcher, which keeps the toolchain. Mixin mods still build with a full rebuild, and modpacks may ship their own game build.Other changes:
#7387 carries a matching notice at its top.
@BlueGradientHorizon commented on GitHub (Nov 2, 2026):
I'm glad this got attention — thank you for building on #5109 rather than letting it sit. I also understand the limits of the
cdylib+ C table I originally proposed; the flip to Rustdylibs reads as a pragmatic call, and the toy build + the pass mark look honest.There is one thing I'd like to ask the maintainers: please keep "ship the
dylibbuild of the game prebuilt" on the table, and I have three reasons.Ordinary players should never wait for a full client build on their own machine. With a prebuilt game
dylib, updating the game is a download, and per-mod rebuilds stay in the seconds range. Without it, every game update puts the ~7-minute build back onto the player's PC — which quietly reintroduces the exact problem #5109 was about, just less often.Sooner or later mobile platforms will have to be supported, and a full from-source client build on a non-flagship phone may simply not be possible (memory for linking, thermal throttling, no room for a multi-GB target dir). I build and run the dedicated server on an Android phone myself, so I know what that hardware can and cannot do. A prebuilt game
dylibper platform is the only rescue there: download the game, compile only the small mod crates locally — or nothing at all, if the mod ships from the registry.The "Decisions so far" section already lets modpacks ship their own game build. If a modpack can be a prebuilt artifact, the base game should be allowed the same: otherwise the fix covers modpacks but not ordinary players, who are the exact audience #5109 was written for. The machinery (CI-built, signed, per-platform game
dylib) is the same in both cases — it's only a question of who is allowed to use it.One last thought, gently: requiring a heavy developer toolchain on a player's machine just to play with mods remains an unusual, almost exotic architectural decision. I'm not aware of a single precedent in the history of game modding — everywhere else the player downloads artifacts and only the author or CI builds. The
dylibroute at least shrinks the wait from minutes to seconds, but the toolchain itself is still a toll booth most players have never seen. Prebuilt game builds would lower it as far as this architecture allows.@arismoko commented on GitHub (Nov 2, 2026):
@BlueGradientHorizon
Hi actual Ari here.
I agree with not having a toolchain distributed with the launcher as a long-term plan. For now the launcher should implement it so we can land the work and potentially revisit the cdylib route for prebuilt mods once I can convince the modding team 😨
The goal is to make the mod API complete enough that the most popular complex mods never need mixins. Then mixins are only for modpack distributors.
Maybe for the short term a disclaimer like: "These mods need a Rust toolchain and are built on your computer. This takes a few seconds per mod, and a few minutes for mods that change the game itself." Is the way to go.
@BlueGradientHorizon commented on GitHub (Nov 2, 2026):
Thank you for replying, I genuinely appreciate it, and I'm glad to hear it. I hope that for starters you'll also be able to bring them around on prebuilt client dylib builds: that alone would take the full game compile off players' machines while the rest of the plan lands. I won't write anything else in this issue, since I have already received answers to all my questions.
@JuanLuci commented on GitHub (Nov 2, 2026):
🤖 Agent (for JuanLuci): Thanks for the answer and the correction. "New crates are allowed if no locked crate changes" would cover this case, since a Showdown bridge is a crate only the mod uses, so that's my vote on question 2. Until that's decided I'll prototype it as a separate crate.
A data point from a test mod with no mixins: a real Cobblemon model with its animations draws over a renamed vanilla mob through
mob_submitanddraw_cube, and a mod-only edit rebuilds in about a second (on a hand-built stage, not yet through the launcher). What it can't do yet: its own mob type (#5212), a sprite registered at run time, and mob movement or goals from the trait API (#7417).@SWIRCH commented on GitHub (Nov 2, 2026):
+1 to JuanLuci’s point on question 2. Server-admin use case: a mod that embeds a Lua interpreter (e.g. mlua) as a private crate, so admins build once and then drop in script files. Same rule would cover it. Is a scripting host something the team would welcome as an ordinary mod, or would you prefer to keep it upstream?