#(1.21.5) Missing texture after adding armor trim to custom armor

43 messages · Page 1 of 1 (latest)

dense lake
#

Greetings. I recently started mod development, and I started with fabric. I'm studying it with Kaupenjoe's video series (intended for version 1.21.1, although there were breaking changes, the syntax is almost the same). I'm in the part of creating custom armors, and they work fine in the base state, but after adding a blacksmithing template, the design is displayed correctly in the game, but the item in the inventory shows the missing texture icon (pink and black mozaic). I updated the texture references and applied the changes for the new versions (create files resources/assets/minecraft/atlases/armor_trims.json and resources/assets/tutorialmod/equipment/pink_garnet.json).

Also, I am using to generate the other resources:


itemModelGenerator.registerArmor(
                ModItems.PINK_GARNET_CHESTPLATE,
                RegistryKey.of(EquipmentAssetKeys.REGISTRY_KEY, TutorialMod.getIdentifierForModAsset("pink_garnet")),
                TutorialMod.getIdentifierForModAsset("pink_garnet_chestplate"),
                false
        );

        itemModelGenerator.registerArmor(
                ModItems.PINK_GARNET_LEGGINGS,
                RegistryKey.of(EquipmentAssetKeys.REGISTRY_KEY, TutorialMod.getIdentifierForModAsset("pink_garnet")),
                TutorialMod.getIdentifierForModAsset("pink_garnet_leggings"),
                false
        );

        itemModelGenerator.registerArmor(
                ModItems.PINK_GARNET_BOOTS,
                RegistryKey.of(EquipmentAssetKeys.REGISTRY_KEY, TutorialMod.getIdentifierForModAsset("pink_garnet")),
                TutorialMod.getIdentifierForModAsset("pink_garnet_boots"),
                false
        );

What would be the change I am missing?

stiff charm
#

1.21.5 is diff from 1.21.1 in that

#

also for what you made a atlases/armor_trims?

dense lake
stiff charm
#

Why?

#

Thats for custom trims (templates/materials)

#

Oh wait I thought you said yes to the atlas/armor_trim

dense lake
#

Do you have any docs for that?

stiff charm
#

Uh not really I just did what minecraft did mostly for it

#

But I also added my custom trim to show so I didn't use the minecraft method

#

Tho should work

dense lake
#

Hum... Can I see a code snippet?

stiff charm
#

For which?

dense lake
#

Both 😅

stiff charm
#

And all I do to generate them is write this:

        generateTrimmableItem(BSItems.BIOMASS_HELMET, BSEquipmentAssets.BIOMASS);
        generateTrimmableItem(BSItems.BIOMASS_CHESTPLATE, BSEquipmentAssets.BIOMASS);
        generateTrimmableItem(BSItems.BIOMASS_LEGGINGS, BSEquipmentAssets.BIOMASS);
        generateTrimmableItem(BSItems.BIOMASS_BOOTS, BSEquipmentAssets.BIOMASS);
#

-# that's the whole set)

dense lake
#

Wow. You went straight to the roots for the trims 😅

#

Maybe I should do the same

stiff charm
#

Wdym?

#

I just copied mostly and made it as simple as I could

#

Bcz I don't need to give the ArmorType anymore lol

dense lake
#

Yeah but where did you get it from?

#

So I can see the mc main implementation

stiff charm
#

The method you used

dense lake
#

Wich is...?

#

Also, I get this error in console:

[Worker-Main-7/WARN] (Minecraft) Missing textures in model tutorialmod:item/pink_garnet_leggings_amethyst_trim:
    minecraft:textures/atlas/blocks.png:tutorialmod:pink_garnet_leggings_amethyst```
#

I dont get how is it a missing texture, but i can she the item in my player

stiff charm
#

oh waiit

#

you gave the items the trimmable tag right ?

dense lake
#

Im not quite sure...

#

TBH, I dont know where to check either

#

I think I did

stiff charm
#

I would take a look at the code myself

#

since its odd that it doesnt show them

dense lake
#

I've been migrating to 1.21.5 with stuff I find in docs and the fabric repo

stiff charm
#

why?

#

theres an official template

#

1.21.4 but 1.21.5 is similar tho

dense lake
#

I got the error from a github discussion. I'll leave it here for future references, in case someone need it

#

The third parameter of the method itemModelGenerator.registerArmor must be the minecraft armor prefix, not the mod prefix.

// Instead of this
itemModelGenerator.registerArmor(
                ModItems.PINK_GARNET_BOOTS,
                RegistryKey.of(EquipmentAssetKeys.REGISTRY_KEY, TutorialMod.getIdentifierForModAsset("pink_garnet")),
                // Incorrect id
                TutorialMod.getIdentifierForModAsset("pink_garnet_boots"), 
                false
        );
// Use this
itemModelGenerator.registerArmor(
                ModItems.PINK_GARNET_BOOTS,
                RegistryKey.of(EquipmentAssetKeys.REGISTRY_KEY, TutorialMod.getIdentifierForModAsset("pink_garnet")),
                //Correct ID  (it has prefixes for all armor slots)
                ItemModelGenerator.BOOTS_TRIM_ID_PREFIX,
                false
        );

Happy Coding 😸😸😸