AzureLib

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

Now simply call the AzItemRendererRegistry#register() in your onInitializeClient for Fabric and FMLClientSetupEvent for Neoforge/Forge

AzItemRendererRegistry.register(ExampleItemRenderer::new, YourItemRegistry.YOUR_ITEM);