Creating Static (No Animations) Items

Creating your Renderer

This renderer is responsible for how your custom item is displayed in the game.

It connects the item with the following:

  1. Geometry file (geo.json): Defines the 3D model of the item.
  2. Texture file (.png): The visual appearance of the item (applies over the geometry).
public class ExampleItemRenderer extends AzItemRenderer {
private static final ResourceLocation GEO = ResourceLocation.fromNamespaceAndPath(
YOUR_MOD_ID,
"geo/item/exampleitem.geo.json"
);
private static final ResourceLocation TEX = ResourceLocation.fromNamespaceAndPath(
YOUR_MOD_ID,
"textures/item/exampleitem.png"
);
public ExampleItemRenderer() {
super(
AzItemRendererConfig.builder(GEO, TEX).build()
);
}
}

Registering your Renderer

Call AzItemRendererRegistry#register() in your onInitializeClient for Fabric, or inside event.enqueueWork(...) in your FMLClientSetupEvent handler for NeoForge.

Fabric:

@Override
public void onInitializeClient() {
AzItemRendererRegistry.register(ExampleItemRenderer::new, YourItemRegistry.YOUR_ITEM);
}

NeoForge:

private void onClientSetup(FMLClientSetupEvent event) {
event.enqueueWork(() -> {
AzItemRendererRegistry.register(ExampleItemRenderer::new, YourItemRegistry.YOUR_ITEM);
});
}