Replace nametags while the render state is built, on every version
Check / compile (pull_request) Successful in 2m49s

NametagsMixin hooked EntityRenderer.renderLabelIfPresent with a
VertexConsumerProvider, which 1.21.9 moved to the render command queue, so
custom nametags only worked before 1.21.9 (#30).

LivingEntityRendererMixin already captures health and entity type at the
end of LivingEntityRenderer.updateRenderState. It now also applies
NametagsMod's replacement to state.displayName there, the label the
renderer draws later. This works the same on every version, so
NametagsMixin and its features.mixins.json entry are gone.

As before, only entities that already show a label get a replacement. For
players, the role icon is added after this (PlayerEntityRendererMixin), so
it now comes before the replaced name and keeps its colour, instead of
being folded into the replacement text.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-09-27 07:13:54 +02:00
co-authored by claude
parent b5ca9dbc8f
commit 22a7152f0d
7 changed files with 29 additions and 122 deletions
-1
View File
@@ -9,7 +9,6 @@
"render.LivingEntityRendererMixin",
"render.LivingEntityRenderStateMixin",
"render.BackgroundRendererMixin",
"misc.NametagsMixin",
"render.RenderMixin",
"world.TpsMixin",
"entity.CameraMixin",