#1.21.5 item model name get?

20 messages · Page 1 of 1 (latest)

quartz fable
#

If I have the ItemStack of a minecraft:compass how do I get from that to an Identifier for minecraft:item/compass_16 or 17 or etc? Is there any easy way to do that at all?

ashen trench
quartz fable
#

itemstacks exist on the clientside

#

this is a client mod

#

and I know I can get the ItemModel by using the bakedmodelmanager and the DataComponentTypes.ITEM_MODEL but I don't know how to get to the next step of getting the specific (I guess sub model??) that it evaluates to

dark heart
#

The compass should contain a component which defines the model? For example the CustomModelDataComponent which cab be used in a model predicate

quartz fable
quartz fable
#

hello?

lucid stream
#

item model component

#
Minecraft Wiki

Data components, or simply components, are structured data used to define and store various properties. They are used on items, where they are referred as item components or item stack components, and block entities, partially replacing NBT format.
Data components are used in various places, including the player's inventory, container block enti...

plain gyro
#

The problem is, to get the actual model, you gotta walk the tree, cause models are trees now, and I don't think Mojang provides a way to do that currently. Might be wrong

quartz fable
#

Oh so there's no way to walk the tree without implementing all item models myself?

plain gyro
#

implementing?

quartz fable
#

yeah

plain gyro
#

I would probably use some reflection or mixingen, but idk

#

And it won't work for custom unbakeds

quartz fable
# plain gyro And it won't work for custom unbakeds

Yeah this is one of the things I'm worried about like if I walk through it myself then it wont work for mods or if Mojang adds new types, which is why I tried to find the way that Minecraft does it but I couldn't figure it out which is why I asked for help, is it really not feasible to do?

#

What is mixingen?

plain gyro
#

Probably not, but it could probably be made to work in some cursed way