[GH-ISSUE #5720] Item models are invisible when their texture is in a folder that the pack adds to the blocks atlas (e.g. assets/minecraft/textures/custom/): such textures are never packed #1784

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

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

Originally assigned to: @doodlyyousuf on GitHub.

Version: Nightly 2026-10-31 (68ac6f6). The same code is on main (c51dcda).

What happens
Our resource pack adds its own sprite folders in assets/minecraft/atlases/blocks.json, for example {"type":"directory","source":"custom","prefix":"custom/"}. Our vehicle and helicopter item models (minecraft:diamond_hoe, range_dispatch on damage, the stack is unbreakable) use textures such as custom/cars/motor_orange. In vanilla 26.3 they render. In Horizon the model is invisible everywhere: in the hotbar, in the hand and on item_display entities (our cars and helicopters are item displays). 227 of our 230 models are affected.

I checked it on a local Paper 26.3 server: the same model renders correctly in Horizon once its texture is copied to textures/item/ and the model points there (screenshot attached).

Steps to reproduce (minimal pack)

  1. assets/minecraft/atlases/blocks.json: {"sources":[{"type":"directory","source":"custom","prefix":"custom/"}]}
  2. assets/minecraft/textures/custom/test.png: any 16×16 texture.
  3. assets/minecraft/models/custom/test.json: a cube model, {"textures":{"0":"custom/test"},"elements":[{"from":[0,0,0],"to":[16,16,16],"faces":{"north":{"uv":[0,0,16,16],"texture":"#0"},"south":{"uv":[0,0,16,16],"texture":"#0"},"east":{"uv":[0,0,16,16],"texture":"#0"},"west":{"uv":[0,0,16,16],"texture":"#0"},"up":{"uv":[0,0,16,16],"texture":"#0"},"down":{"uv":[0,0,16,16],"texture":"#0"}}}]}
  4. assets/minecraft/items/paper.json: {"model":{"type":"minecraft:model","model":"minecraft:custom/test"}}
  5. Hold paper or show it on an item_display: vanilla draws the cube, Horizon draws nothing.

Cause

Suggested fix
Keep the have.contains(name) check just above it (it already covers every walked file) and drop the second skip, or limit that skip to paths under the walked folders.

Image Image Image
Originally created by @itsmyfox on GitHub (Nov 1, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/5720 Originally assigned to: @doodlyyousuf on GitHub. **Version:** Nightly 2026-10-31 (68ac6f6). The same code is on `main` (c51dcda). **What happens** Our resource pack adds its own sprite folders in `assets/minecraft/atlases/blocks.json`, for example `{"type":"directory","source":"custom","prefix":"custom/"}`. Our vehicle and helicopter item models (`minecraft:diamond_hoe`, `range_dispatch` on `damage`, the stack is `unbreakable`) use textures such as `custom/cars/motor_orange`. In vanilla 26.3 they render. In Horizon the model is invisible everywhere: in the hotbar, in the hand and on `item_display` entities (our cars and helicopters are item displays). 227 of our 230 models are affected. I checked it on a local Paper 26.3 server: the same model renders correctly in Horizon once its texture is copied to `textures/item/` and the model points there (screenshot attached). **Steps to reproduce (minimal pack)** 1. `assets/minecraft/atlases/blocks.json`: `{"sources":[{"type":"directory","source":"custom","prefix":"custom/"}]}` 2. `assets/minecraft/textures/custom/test.png`: any 16×16 texture. 3. `assets/minecraft/models/custom/test.json`: a cube model, `{"textures":{"0":"custom/test"},"elements":[{"from":[0,0,0],"to":[16,16,16],"faces":{"north":{"uv":[0,0,16,16],"texture":"#0"},"south":{"uv":[0,0,16,16],"texture":"#0"},"east":{"uv":[0,0,16,16],"texture":"#0"},"west":{"uv":[0,0,16,16],"texture":"#0"},"up":{"uv":[0,0,16,16],"texture":"#0"},"down":{"uv":[0,0,16,16],"texture":"#0"}}}]}` 4. `assets/minecraft/items/paper.json`: `{"model":{"type":"minecraft:model","model":"minecraft:custom/test"}}` 5. Hold paper or show it on an `item_display`: vanilla draws the cube, Horizon draws nothing. **Cause** - `HudAtlas::build_over` walks only `gui`, `item`, `block`, `font`, `environment`, `misc`, `painting`, `entity`, `particle`, `mob_effect` and `map` under `assets/minecraft/textures`. https://github.com/horizon-rust/horizon/blob/c51dcda0118881824ddf9be4e8caaa4a8541aee7/crates/horizon-client-render/src/hud.rs#L348-L366 - `atlas_sprites` then skips every `minecraft:` file source whose sprite name equals its texture path, on the assumption that the walk already packed it. For `custom/...` (or any other folder outside that list) it did not, so the sprite never exists. https://github.com/horizon-rust/horizon/blob/c51dcda0118881824ddf9be4e8caaa4a8541aee7/crates/horizon-client-render/src/hud.rs#L242-L249 **Suggested fix** Keep the `have.contains(name)` check just above it (it already covers every walked file) and drop the second skip, or limit that skip to paths under the walked folders. <img width="1120" height="160" alt="Image" src="https://github.com/user-attachments/assets/e5006d4f-25bb-4c39-b33f-d31c75892244" /> <img width="1600" height="900" alt="Image" src="https://github.com/user-attachments/assets/0b675c13-5a96-40ae-ac07-8c27611f356a" /> <img width="1600" height="900" alt="Image" src="https://github.com/user-attachments/assets/8aa1f3e8-eb8d-4eaa-b0fa-eda738a4cbc9" />
Author
Owner

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

🤖 Agent: /claim

<!-- gh-comment-id:6553623748 --> @doodlyyousuf commented on GitHub (Nov 1, 2026): 🤖 Agent: /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#1784
No description provided.