Skip to content

Fix custom model data for 1.21.6+ - #36

Open
Jukoz wants to merge 2 commits into
Supermarcel10:masterfrom
Jukoz:master
Open

Fix custom model data for 1.21.6+#36
Jukoz wants to merge 2 commits into
Supermarcel10:masterfrom
Jukoz:master

Conversation

@Jukoz

@Jukoz Jukoz commented Jan 26, 2026

Copy link
Copy Markdown

Description

Fixed the plugin for 1.21.6+ version with the new custom model data changes made by Mojang. Has been tested on dev & public servers.

Type of change

  • Bug fix
  • New feature
  • Enhancement
  • Documentation update

How Has This Been Tested?

Tested on paper-1.21.6-48 server

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Additional Notes

These changes won't support your previous versions, up to you on how you want to manage this with your version conditions or simply splitting into different builds/branches. I saw your CustomModelData class with conditions on the mc version, but I don't want to mess up anything there, so I'm just showing the solution for recent versions.

@Supermarcel10

Supermarcel10 commented Jan 27, 2026

Copy link
Copy Markdown
Owner

Thank you for opening a PR!

I have spooled up a paper-1.21.6-48 server. The example resource pack works out of the box with version 2.2.0 (from master branch).

image

On the same version server, the example resource pack with this branch does not seem to work and does not append correct model data.

image

I have also tested on:

  • paper 1.21.4-232-ver/1.21.4@12d8fe0
  • paper 1.21.6-48-main@4d854e6
  • paper 1.21.10-117-ver/1.21.10@df4b668

I was unable to reproduce any issues. This makes me believe maybe there are differences in how the resource pack is constructed.

Is it possible to get more insight on what the original issue is? Would you happen to have a resource pack I can take a look at to debug further?

@Jukoz

Jukoz commented Jan 27, 2026

Copy link
Copy Markdown
Author

I see, yeah looking back at it, it's the way I made my resourcepack that is different from your example. Before on 1.21.1 and prior, both were written in the same way, but now my minecraft:items/feather.json looks like this:

  "model": {
    "type": "minecraft:range_dispatch",
    "property": "minecraft:custom_model_data",
    "index": 0,
    "entries": [
      { "threshold": 1, "model": { "type": "minecraft:model", "model": "mypack:item/hat1" } },
      ...

which uses float/int instead of strings like in your example.
I guess I could convert it to strings, but I was too lazy to change hundreds of entries so I thought I'd modify few lines of code (which works for what I have currently).
But yeah glad to see it still works for recent versions and it was just a "me issue".

@Supermarcel10

Copy link
Copy Markdown
Owner

I will look in the coming week to see if I can support both resource pack definitions. Could also stem from a documentation issue, as I think the current wiki lacks updates on the 1.21.3+ situation. It's completely valid that people might not know.

Thanks for bringing it up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants