Jump to content

[SOLVED] [1.7.10] Adding team name prefixes


ExcelsiorVFX

Recommended Posts

I am trying to create teams with name prefixes using the vanilla scoreboard system. Here is my code:

 

scoreboard = new Scoreboard();

	redTeamScore = scoreboard.createTeam("Red");
	blueTeamScore = scoreboard.createTeam("Blue");
	greenTeamScore = scoreboard.createTeam("Green");

	redTeamScore.setAllowFriendlyFire(false);
	redTeamScore.setNamePrefix(RED + "[RED] " + BOLD);

	blueTeamScore.setAllowFriendlyFire(false);
	blueTeamScore.setNamePrefix(BLUE + "[bLUE] " + BOLD);

	greenTeamScore.setAllowFriendlyFire(false);
	greenTeamScore.setNamePrefix(GREEN + "[GREEN] " + BOLD);

	scoreboard.broadcastTeamCreated(redTeamScore);
	scoreboard.broadcastTeamCreated(blueTeamScore);
	scoreboard.broadcastTeamCreated(greenTeamScore);

 

Then I add a player to the team:

 

scoreboard.func_151392_a(player, "Red")

 

The method returns true. However, in-game, the players' names do not change. What am I doing wrong? Am I missing a packet or something?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.