@SubscribeEvent
@SideOnly(Side.CLIENT)
public static void registerRenders(ModelRegistryEvent event)
{
ModelBakery.registerItemVariants(ModItems.EXAMPLE_ITEM, new ModelResourceLocation(ModItems.EXAMPLE_ITEM.getRegistryName(), "inventory"));
for (ItemType itemType : ItemType.itemTypes)
{
ModelBakery.registerItemVariants(ModItems.EXAMPLE_ITEM, itemType.itemModel);
}
ModelLoader.setCustomMeshDefinition(ModItems.EXAMPLE_ITEM, new ItemMeshDefinition()
{
@Override
public ModelResourceLocation getModelLocation(ItemStack stack)
{
if (stack.getTagCompound() != null)
{
return new ModelResourceLocation(Mod.MODID + ":" + stack.getTagCompound().getString("ItemType"), "inventory");
}
else
{
return new ModelResourceLocation(Mod.MODID + ":" + defaultTexture, "inventory");
}
}
});
}
Here's an example of what I mean. You would register all the model variants for your item, then use the getModelLocation method to return a different model depending on itemstack properties. Apologies if that was unclear. This was for 1.12.2, not even sure if this was the correct way to do it, but I can't work out the way to do it for 1.13.2.