Minecraft – Hiding team colors in usernames

minecraft-commandsminecraft-java-edition

I'm working on a minigame in Minecraft that is built upon not knowing what role other people are (kind of like a social deduction game). However, since teams are required for the game to function, a player can simply look in the tab menu and see the colors of every person, ruining the game. Is there a way to overwrite the colors of the names?

I can't change the team colors to the same, as the game uses the killedByTeam.<color>  objective to function

Best Answer

Just run the follow command and replace the parts to what is what.

/team modify <team> displayName {"text" : "<text>", "color" : "#<hex>"}

Use the player kills scoreboard and use a execute command to see what team they are on. Make a scoreboard dummy type for each team and depending on what team the player is on increase the team scoreboard. I hope this helps.