neoforged / NeoForge

Neo Modding API for Minecraft, based on Forge
https://neoforged.net
Other
1.24k stars 179 forks source link

[1.21.3] Custom name tag component set in `RenderNameTagEvent$CanRender` is ignored #1667

Open Fuzss opened 2 weeks ago

Fuzss commented 2 weeks ago

Minecraft Version: 1.21.3

NeoForge Version: 21.3.4-beta

The component in EntityRenderState#nameTag is always set from EntityRenderer::getNameTag, RenderNameTagEvent$CanRender::getContent is never used.

Also on a side note it is no longer possible to render name tags for entities more than 64 blocks away due to RenderNameTagEvent$CanRender only being called when entity.distanceToCameraSq < 4096.0, which wasn't the case before 1.21.2. Before only the name tag renderer would check the distance, and by cancelling the event and rendering the name tag yourself it was possible to bypass the distance check.