EntityCulling icon indicating copy to clipboard operation
EntityCulling copied to clipboard

RenderNameTagEvent not being called

Open pitbox46 opened this issue 8 months ago • 1 comments

Using: Neoforge 1.21

Neoforge has a built in event (Forge as well) RenderNameTagEvent that gets called at EntityRender#render() before EntityRender#renderNameTag() gets called. For culled entities, this event gets skipped. The event should be called at either EntityRendererMixin#shadowRenderNameTag() or WorldRendererMixin#renderEntity() before the name tag gets rendered.

This fix will enable my mod, Hidden Names to work properly with this mod. I'll be implementing a quick fix until this can be gotten to.

pitbox46 avatar Mar 10 '25 22:03 pitbox46

I've looked into it, but this will be really tricky and slow. The event needs stuff like the renderState, which doesn't exist since EntityCulling is skipping the rendering, so a renderstate is never created/filled. Triggering these events correctly will require a ton of code (thanks to the many forge/neoforge differences over the versions), and actively hurt the performance. I'll push this back for now, in the future putting this behind a setting to skip the event sounds like a better idea.

tr7zw avatar Mar 27 '25 14:03 tr7zw