Set player name?

Discussion in 'Plugin Development' started by Meatiex, Oct 29, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    Meatiex

    I want to set my player's names to:
    Scoarboard Team Color + Player's Name + Dies on Scoarboard
    Heres some code, but it makes the player's name white (No Team Color or dies count)
    I want to do it this way instead of with all scoarboards becuase I want to add a symble before the player's name.
    Code:java
    1. @EventHandler
    2. public void PlayerDeathEventt(PlayerDeathEvent event) {
    3. Player player = event.getEntity();
    4. ScoreboardManager manager2 = Bukkit.getScoreboardManager();
    5. Scoreboard board2 = manager2.getNewScoreboard();
    6. Objective objective2 = board2.getObjective("dies");
    7.  
    8. Team team = board2.registerNewTeam(player.getName());
    9. String color = team.getName();
    10. Score points = objective2.getScore(player);
    11. event.getEntity().setCustomName(color + player.getName() + " " + points + " Test");
    12. }

    Any help with this would be awesome :D
     
  2. Offline

    MineDoubleSpace

    You have to use ChatColor.translateAlternateColorCodes so it will actually show the color.
    and for points you defined points as Score,
     
Thread Status:
Not open for further replies.

Share This Page