Fabric API

Fabric API

106M Downloads

[Suggestion] ItemStack model provider?

Takakura-Anri opened this issue · 3 comments

commented

Such as (ItemStack, ModelProviderContext) -> UnbakedModel is needed, as they are very useful in mapping custom models

commented

Could you elaborate on what you’re trying to do? There are already a couple different ways to handle custom item models.

commented

You can't... really do that, though. Not at this level, as BakedModels are keyed by Item, not ItemStack.

ModelItemPropertyOverrideList is what you're looking for, plus providing your own BakedModels. I recommend writing a helper library to handle this, but I don't think it belongs in API unless doable easily.

commented

There are currently two ways to vary item model content based on item stack. The most conventional way is via ModelItemPropertyOverrideList and a custom BakedModel implementation, per Asie's post above. This method is unsuitable for a very large number of variations.

The second way is to implement FabricBakedModel and override emitItemQuads(). This second method provides practically unlimited flexibility but will most performant when model content is statically baked.

The hooks in net.fabricmc.fabric.api.client.model provide the means for injecting custom models.

Closing given that hooks already exist and no additional requirements were given.