API reference Obsidian.API.Client
IItemRenderer interface
Code that draws a mod's special item model type, like NeoForge's SpecialModelRenderer. Give it as ItemRendererProperties.Renderer.
public interface IItemRenderer
In Obsidian.API.Client.
Methods
Render(ItemStack, ItemModelContext, IItemRenderBuffer)
void Render(ItemStack stack, ItemModelContext context, IItemRenderBuffer buffer);Draws a stack into buffer.
Parameters
stack- The stack drawn, with its components and the mod's own; read it, don't change it.
context- Where it's drawn and for whom.
buffer- What the frame draws the item's parts with.
Remarks
It runs each frame for each stack drawn with the type, in menus, in hands, in item frames and on the ground, on the client's game thread inside a call into the mod. Keep it short and free of allocations, as the frame waits for it, and don't change the stack. If it throws, the error is logged, what it drew is dropped and the base model is drawn instead, and it isn't called for the stack again until the stack changes.