Skip to content

Load entity models from the nearest published version - #341

Merged
InventivetalentDev merged 3 commits into
mainfrom
fix/entity-models-fallback
Oct 17, 2026
Merged

InventivetalentDev merged 3 commits into
mainfrom
fix/entity-models-fallback

Conversation

@InventivetalentDev

@InventivetalentDev InventivetalentDev commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

On versions without a published entity-models dataset, block entities now render. A 26.3 bell shows its bell body instead of only the frame, and chests, signs, beds and skulls render too. MineRender loads their geometry from the nearest published release (26.3 uses 26.1.2), the same way MineRenderData already falls back for registry data. Textures still come from the requested version.

Why

minecraft-entity-models is published for 1.16.5, 1.17.1, 1.20.1, 1.21.11 and 26.1.2 only. For any other version, BlockEntities.getIndex got a 404 and returned an empty index, so every block entity was drawn as its plain block model, and special items could not find their geometry. mcasset.cloud hits this on 26.3: https://mcasset.cloud/26.3/assets/minecraft/blockstates/bell.json shows only the frame.

Changes

  • Entities.getDatasetRoot(root?) (new, public):
    • A version that isn't a release, such as a snapshot or a custom root, returns the root unchanged without a request.
    • Otherwise it probes <root>/entity-models/version.json (one request per version, cached); a published version returns the root unchanged.
    • Otherwise it picks the nearest release listed in entity-models/versions.json.
    • getModelFile, getAnimations, getEntityList and BlockEntities.getIndex use it. Texture code is unchanged, so textures keep the caller's root.
  • assets/_versions/DatasetVersions.ts: parseRelease and nearestRelease moved here unchanged from MineRenderData.ts, which now uses them. The underscore directory keeps them out of the generated barrels, so they stay internal. Its behaviour and messages are the same.
  • Caching.entityDatasetVersionCache: caches the chosen version per root and clears with the other caches.
  • Snapshots: no fallback; they keep today's behaviour.
  • Errors: a malformed version index rejects. getIndex still turns that into {} with its existing warning.
  • Docs: reference/concepts.md and the AGENTS.md Entities paragraph.

Selection examples:

Requested Geometry from
26.3 26.1.2
1.21.4, 1.21.10 1.21.11
1.21.11 1.21.11 (unchanged)
26.3-snapshot-1 26.3-snapshot-1 (no fallback)

Testing

  • yarn workspace minerender typecheck
  • yarn test: 803 passed
  • yarn build:lib && yarn test:package: 11 passed
  • New tests:
    • an unpublished release loads geometry and the block index from the fallback, while the texture keeps the requested root;
    • published versions and snapshots never request the version list;
    • a missing index keeps the root; a malformed one rejects, and getIndex returns {}.
  • Existing tests in five files changed for the extra version.json request only. They either answer it as published, shift a count or key index by one, or seed the version cache. No assertion was relaxed.
  • Built package against assets.mcasset.cloud: 26.3 resolves to 26.1.2, the bell is in the index, and the bell model loads with a 26.3 texture root. 1.21.11 is unchanged.
  • mcasset.cloud dev server with this build: the 26.3 bell renders with its gold body.

🤖 Generated with Claude Code

The entity-models dataset is published for a few versions only (1.16.5, 1.17.1,
1.20.1, 1.21.11, 26.1.2). For any other version, block entities such as the
bell body, chests and signs fell back to their block models, and special
items could not find their geometry.

Entities.getDatasetRoot now probes <root>/entity-models/version.json and, for
an unpublished release, selects the nearest published one from
entity-models/versions.json with the same rule as MineRenderData.resolve.
Model files, entity lists, animations and the block-entity index load from
that root; textures keep the requested version. Snapshots keep their own
version. The shared selection code moves to DatasetVersions.ts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added library Public minerender package (packages/minerender) docs Documentation site, READMEs, and docs/ branches fix Bug fix (fix/ branches) labels Oct 17, 2026
InventivetalentDev and others added 2 commits October 17, 2026 16:57
DatasetVersions moves into an underscore directory, so the generated barrels never export
parseRelease and nearestRelease. Roots whose last segment isn't a release, such as
snapshots or custom hosts, skip the version.json request, since its answer can't change
the result.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@InventivetalentDev
InventivetalentDev merged commit 29eea8b into main Oct 17, 2026
3 checks passed
@InventivetalentDev
InventivetalentDev deleted the fix/entity-models-fallback branch October 17, 2026 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation site, READMEs, and docs/ branches fix Bug fix (fix/ branches) library Public minerender package (packages/minerender)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant