Creating your Renderer
This renderer is responsible for how your armor is displayed in the game.
It connects the armor with the following:
- Geometry file (
geo.json): Defines the 3D model of the armor. - Texture file (
.png): The visual appearance of the armor (applies over the geometry).
public class ExampleArmorRenderer extends AzArmorRenderer {private static final ResourceLocation GEO = ResourceLocation.fromNamespaceAndPath(YOUR_MOD_ID,"geo/item/examplearmor.geo.json");private static final ResourceLocation TEX = ResourceLocation.fromNamespaceAndPath(YOUR_MOD_ID,"textures/item/examplearmor.png");public ExampleArmorRenderer() {super(AzArmorRendererConfig.builder(GEO, TEX).build());}}
Registering your Renderer
Call AzArmorRendererRegistry#register() in your onInitializeClient for Fabric, or inside event.enqueueWork(...) in your FMLClientSetupEvent handler for NeoForge.
Warning
On NeoForge, setup events fire for every mod at the same time on parallel worker threads. Always register inside event.enqueueWork(...), which runs your code on the main thread after every mod's handler has finished, so your registrations can't race another mod's. Registering directly in the event handler can cause renderers to go missing at random between launches. Fabric runs its initializers one after another on a single thread, so no wrapper is needed there.
Fabric:
@Overridepublic void onInitializeClient() {AzArmorRendererRegistry.register(ExampleArmorRenderer::new, YourItemRegistry.YOUR_ARMOR_HELMET,YourItemRegistry.YOUR_ARMOR_CHESTPLATE,YourItemRegistry.YOUR_ARMOR_LEGGINGS,YourItemRegistry.YOUR_ARMOR_BOOTS);}
NeoForge:
private void onClientSetup(FMLClientSetupEvent event) {event.enqueueWork(() -> {AzArmorRendererRegistry.register(ExampleArmorRenderer::new, YourItemRegistry.YOUR_ARMOR_HELMET,YourItemRegistry.YOUR_ARMOR_CHESTPLATE,YourItemRegistry.YOUR_ARMOR_LEGGINGS,YourItemRegistry.YOUR_ARMOR_BOOTS);});}