3

Custom Model Data changed after 1.21. Need help updating code.

StarDotCOB 6/18/24 11:45 am
24.2k
8/5/2024 11:04 pm
I had a simple resource pack that allowed me to change the texture of an item depending on the NBT tag it had.

This code changed a nether_star to a new texture with an NBT tag of 15:
/give @p nether_star{CustomModelData:15}but since 1.21, all of this has broken and I can't get the texture to change anymore.

I've tried going into the json files of the resource pack and I'm pretty sure I know where the issue is, but I don't know enough about json to fix the problem.

In the json file this is how the code worked prior to 1.21:
{ "predicate": { "custom_model_data": 15}, "model": "nether_star/amulet"},
but now in 1.21 the code to give yourself a custom model is this:
/give @p nether_star[Custom_Model_Data=15]So that likely means I need to change the json file code as well to match the new syntax.
But again, I don't know enough about json to fix the problem.

Can someone help me?
Posted by
StarDotCOB
Level 49 : Master Nerd
41

  Have something to say?

JoinSign in

4

RyanSkull
08/05/2024 11:04 pm
Level 24 : Expert Miner
/give @p nether_star[minecraft:custom_model_data=15]
1
Noah_Dekka
07/14/2024 10:54 pm
Level 1 : New Miner
history
I am just trying to update a datapack someone else made for 1.20.

Here's the line I am struggling with:

give @s carrot_on_a_stick{CustomModelData:4000001,Type:"grappling_hook",display:{Name:'{"text":"Grappling Hook","italic":"false"}'}}
1
EternityMine
06/18/2024 7:36 pm
Level 65 : High Grandmaster Artist
I found this generator on github and it works! I tested it and I got my textures to work.

https://misode.github.io/assets/model/?version=1.21

also if you need help using the generator KasaiSora has a yt video on how to use it here:

www.youtube.com/watch?v=x2QwKFE0aQg
1
EternityMine
06/18/2024 6:37 pm
Level 65 : High Grandmaster Artist
I have the same problem, I can give myself the item in the game, but it has the default Minecraft texture, however, the rest of the custom model data is there, such as how it looks while being held, etc. Not sure how to make the texture apply anymore. Help on this subject would be greatly appreciated.
1

Welcome