Skip to content

Fix: Multiplayer/Splitscreen Name Tags#1136

Open
tylerreese543-lab wants to merge 2 commits intosmartcmd:mainfrom
tylerreese543-lab:actual-name-tag-fix
Open

Fix: Multiplayer/Splitscreen Name Tags#1136
tylerreese543-lab wants to merge 2 commits intosmartcmd:mainfrom
tylerreese543-lab:actual-name-tag-fix

Conversation

@tylerreese543-lab
Copy link

@tylerreese543-lab tylerreese543-lab commented Mar 11, 2026

Description

Changes

Fixed the renderNameTags function, so player name tags appear in the correct colors.

Huge thanks to @ayushthoren for helping me with the fix. Most of this is his work but he wanted me to test and send the PR.

Previous Behavior

All name tags for players would render black.

Root Cause

Default "color" argument set to black in LivingEntityRenderer::renderNameTags().

New Behavior

Now queries the player index to get the proper nametagColor.

Fix Implementation

Added a new "nametagColor" int (initialized to black) to each LivingEntity. This can be built upon with dyed nametags (oouu), etc.
Changed PlayerRenderer::renderNameTags to be an override of the original. This initially caused replication errors with nametagColor.
In PlayerRenderer::renderNameTags, it sets nametagColor to getNametagColour(p->getPlayerIndex())
"p" is a player with a player->instanceof(eType_PLAYER) check and dynamic_pointer_cast(). This set is skipped if the entity in question is not a player.

AI Use Disclosure

No AI was used. 🫡

Related Issues

  • Fixes #[issue-number]
  • Related to #[issue-number]

tylerreese543-lab and others added 2 commits March 11, 2026 02:20
Co-Authored-By: Ayush Thoren <ayushthoren@gmail.com>
Co-Authored-By: Ayush Thoren <ayushthoren@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant