[GH-ISSUE #6257] Native mods: player render and entity layers, RenderPlayerEvent and EntityRenderersEvent.AddLayers #2037

Closed
opened 2026-11-02 15:51:31 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @levzzz5154 on GitHub (Nov 1, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/6257

Originally assigned to: @levzzz5154 on GitHub.

🤖 Filed by levzzz5154's AI agent (Claude Code, Claude Sonnet 5.5), not by levzzz5154 personally.

Part of #4953 ("Player render and entity render layers (RenderPlayerEvent, EntityRenderersEvent.AddLayers); the camera and fog (ViewportEvent: #5976, #5992, #6000, #6003), the hand (#5802) and the block highlight (#5804) are done").

native_mob_submit (#5895, RenderLivingEvent.Pre) lets a client mod draw any mob but a player with a model of its own. There is no way to draw a player's model, nor to add something to a model that stays vanilla (a backpack on every player, a hat on a villager, an aura): NeoForge has RenderPlayerEvent.Pre/.Post for players and EntityRenderersEvent.AddLayers (a RenderLayer added to an entity type's renderer, drawn after the model with the model's pose) for everything.

Proposed, in the shape of native_mob_submit (the same BlockEntityDraw frame, posed at the feet and turned with the body, with the same native_draw_* helpers):

  • native_player_submit(player, who, draw, drawn): RenderPlayerEvent.Pre. Once a frame for every other player in view and for the player's own model in third person (and F5 front view). who carries the profile name and whether it is the local player. Setting drawn leaves out the vanilla model, armour, held items, cape and the other layers, as native_mob_submit does for a mob.
  • native_mob_layer(mob, who, draw): EntityRenderersEvent.AddLayers / RenderLivingEvent.Post. Once a frame after the vanilla model and its layers, for every mob and player in view that a mod did not draw itself; who is Some for a player. A mod adds geometry in the entity's frame (a hat at the eye height, turned with head_yaw and pitch).

Where NeoForge's RenderLayer takes the parent model and draws attached to its parts, this gives the mob's render state (NativeMobRender: body, head and walk) and a frame at the feet; a mod computes the part's place from them. The alternative is to expose the baked model's part poses (head, arms, legs) through a helper, which wants a stable naming of parts per model across species; recommended as a follow-up once a mod asks for it. Other alternatives for the first step: one hook for players and mobs (native_mob_submit extended to players) changes what that hook is documented to do ("every mob but players"), so a separate player hook is safer. Client side only. API from a fragment.

Originally created by @levzzz5154 on GitHub (Nov 1, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/6257 Originally assigned to: @levzzz5154 on GitHub. > 🤖 Filed by levzzz5154's AI agent (Claude Code, Claude Sonnet 5.5), not by levzzz5154 personally. Part of #4953 ("Player render and entity render layers (`RenderPlayerEvent`, `EntityRenderersEvent.AddLayers`); the camera and fog (`ViewportEvent`: #5976, #5992, #6000, #6003), the hand (#5802) and the block highlight (#5804) are done"). `native_mob_submit` (#5895, `RenderLivingEvent.Pre`) lets a client mod draw any mob but a player with a model of its own. There is no way to draw a player's model, nor to add something to a model that stays vanilla (a backpack on every player, a hat on a villager, an aura): NeoForge has `RenderPlayerEvent.Pre`/`.Post` for players and `EntityRenderersEvent.AddLayers` (a `RenderLayer` added to an entity type's renderer, drawn after the model with the model's pose) for everything. Proposed, in the shape of `native_mob_submit` (the same `BlockEntityDraw` frame, posed at the feet and turned with the body, with the same `native_draw_*` helpers): - `native_player_submit(player, who, draw, drawn)`: `RenderPlayerEvent.Pre`. Once a frame for every other player in view and for the player's own model in third person (and F5 front view). `who` carries the profile name and whether it is the local player. Setting `drawn` leaves out the vanilla model, armour, held items, cape and the other layers, as `native_mob_submit` does for a mob. - `native_mob_layer(mob, who, draw)`: `EntityRenderersEvent.AddLayers` / `RenderLivingEvent.Post`. Once a frame after the vanilla model and its layers, for every mob and player in view that a mod did not draw itself; `who` is `Some` for a player. A mod adds geometry in the entity's frame (a hat at the eye height, turned with `head_yaw` and `pitch`). Where NeoForge's `RenderLayer` takes the parent model and draws attached to its parts, this gives the mob's render state (`NativeMobRender`: body, head and walk) and a frame at the feet; a mod computes the part's place from them. The alternative is to expose the baked model's part poses (head, arms, legs) through a helper, which wants a stable naming of parts per model across species; recommended as a follow-up once a mod asks for it. Other alternatives for the first step: one hook for players and mobs (`native_mob_submit` extended to players) changes what that hook is documented to do ("every mob but players"), so a separate player hook is safer. Client side only. API from a fragment.
Author
Owner

@levzzz5154 commented on GitHub (Nov 1, 2026):

/claim

<!-- gh-comment-id:6562110671 --> @levzzz5154 commented on GitHub (Nov 1, 2026): /claim
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#2037
No description provided.