Skip to content

API reference Obsidian.API.Client

IEntityRenderer interface

Code that draws a mod's entities each frame, like vanilla's EntityRenderer.render: for what the model, its animations and layers can't describe. Give it as EntityRendererProperties.Renderer.

public interface IEntityRenderer

In Obsidian.API.Client.

Methods

Render(EntityRenderContext, IEntityRenderBuffer)

void Render(EntityRenderContext entity, IEntityRenderBuffer buffer);

Draws an entity into buffer, after its model and layers.

Parameters

entity
The entity, as the frame shows it.
buffer
What the frame draws the entity's parts with.

Remarks

It runs each frame for each of the type's entities in view, 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. If it throws, the error is logged, what it drew that frame is dropped, and it isn't called for the entity again until its metadata changes.

On this page