Skip to content

Custom Trim Pattern

Hipposgrumm edited this page Jul 28, 2025 · 3 revisions

Trim patterns are applied to items for cosmetic effect. Adding new trim patterns requires using the mod's API.

Registering a trim pattern is similar to registering any other type, and can be done in your mod's class initializer. For instance:

public static final ArmorTrimPattern NYAA_TRIM = TrimRegistry.registerTrim(
                new ResourceLocation(MODID, "nyaa"),
                new ArmorTrimPattern(
                                new ResourceLocation(MODID, "textures/trims/models/armor/nyaa.png"),
                                new ResourceLocation(MODID, "textures/trims/models/armor/nyaa_leggings.png")
                )
);

The first parameter is the ID that the trim will use. The second is the actual trim pattern associated with that ID.
Trim patterns don't necessarily need to be armor trims, though that is the most common usage.

Smithing Template

It is recommended to create a smithing template for your trim. This template can also be registered like a normal item.

// This is a Fabric implementation. Do Forge stuff for Forge.
public static final ArmorTrimSmithingTemplate NYAA_SMITHING_TEMPLATE = Registry.register(Registry.ITEM,
                new ResourceLocation(MODID, "nyaa_armor_trim_smithing_template"),
                new ArmorTrimSmithingTemplate(
                                NYAA_TRIM,
                                () -> Ingredient.of(Armortrims.TRIM_MATERIALS_TAG),
                                new Item.Properties().tab(CreativeModeTab.TAB_MATERIALS).stacksTo(1); // Recommended
                )
);

There is also an abstracted SmithingTemplate that can be used for other purposes (E.G. Netherite Upgrade).

Clone this wiki locally