Patbox / StyledNicknames

Simple, but configurable nicknaming mod allowing your server's players (and admins) to change their nickname with full formatting support
GNU Lesser General Public License v3.0
12 stars 7 forks source link

Reflect nicknames on scoreboards #23

Open HoldYourWaffle opened 2 days ago

HoldYourWaffle commented 2 days ago

It'd be great if nicknames could be reflected on scoreboards.

I might have some time to take a shot at this in a couple days, though I could see this being challenging to implement due to MC-50247...

Patbox commented 2 days ago

Try using the /scoreboard objectives modify OBJECTIVE displayautoupdate true. It should make it update once score changes

HoldYourWaffle commented 2 days ago

Huh, that's an interesting mechanic. It seems to work, though with some downsides:

  1. All (visible) scoreboards need to be manually configured for this.
  2. Nickname changes are only propagated when a score changes.
  3. This replaces the vanilla "set specific display name to override player name" mechanic.
  4. Nicknames end up persisted in scoreboards.dat.

I wonder if this could be accomplished by hijacking something like ScoreboardScoreUpdateS2CPacket. That'd make it purely a visual change for clients, which I'd expect to be safer. Some initial poking seems promising, though there's a weird interaction with team coloring that I haven't figured out yet.

I also looked into PlayerEntity.getNameForScoreboard, but those values are persisted in even more troublesome ways and would almost certainly break compatibility with something like Score Migrator.