PlayersNametags

Discussion in 'Bukkit Help' started by nightwolf111, Aug 17, 2016.

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

    nightwolf111

    hey guys, i wanted to make a plugin that has two teams but the problem is that i don't know how to make the player's nametag that is in the team red for example red, i looked through all the websites but i didn't find a solution, i tried to use the TagAPI but it's last version is 1.7.9 and i am working with 1.10.

    pm : i saw a topic that shows how to do this but the skin changes to steve i don't want that to happen :(
     
    Last edited: Aug 17, 2016
  2. Offline

    Rayzr522

  3. Offline

    nightwolf111

    i didn't understand what you mean exactly i saw this page before they said that they won't update the TagAPI anymore and to search for another plugin but i didn't find anyone :(
     
  4. Offline

    HeartandSoul

    You don't need the API. Make a scoreboard in your plugin. Then set teams. Have the player trying to join the team execute a command. Set the display to player list (Tab)
     
  5. Offline

    Rayzr522

    @nightwolf111
    As @HeartandSoul said, make a scoreboard etc.
    I was pointing out that it says that even on the TagAPI page: https://dev.bukkit.org/bukkit-plugins/tag/#w-but-i-want-to-add-colors-to-usernames
    "I suggest finding a plugin that lets you do that using the built-in scoreboard system"
    EDIT: You don't even need a plugin. Just set up teams. On one little vanilla server of mine I had a team for each color, and so I just assigned my friends the color they wanted by doing /scoreboard teams join <color> <playername> or something like that.
     
  6. Offline

    nightwolf111

    @HeartandSoul so you mean i set the color of player in the tab list for example red and i set the displayname of the player is the playerlistcolor ?


    @Rayzr522
    with mc commands you can do it i know that but i need with bukkitAPI cuz i am making a minigame and i need to know how to do it :(
     
  7. Offline

    Rayzr522

  8. Offline

    nightwolf111

    i checked it but i didn't find any solution the team.optin can only set the player nametag visibility it can't set the color of the team ;_;
     
  9. Offline

    HeartandSoul

    Yes, you create a scoreboard and set the color of the player. To do so, make a team first. It is spoonfeeding, but here is some code to help you get that working!

    Code:
                    ScoreboardManager scoreboard = Bukkit.getServer().getScoreboardManager();
                    Scoreboard board = scoreboard.getNewScoreboard();
                    board.registerNewTeam("&6&lExampleTeam");
                    //stuff / logic
    This is just to register a team. Do other things with this. Keep in mind that it's an example and isn't intended to work, or if it's even right.
     
  10. Offline

    nightwolf111

    @HeartandSoul

    i already did that but it didn't change the color of the player's nametag it's just a name
     
  11. Offline

    HeartandSoul

  12. Offline

    nightwolf111

  13. Offline

    HeartandSoul

    Ok, when you are making a new team in a scoreboard, there is a setPrefix method for it. it takes a string, supports chatcolors (ex: team.setPrefix(ChatColor.BLUE + "");

    Edit: Tried to put 'B' in brackets in the string. Made it bold instead xD
     
  14. Offline

    nightwolf111

    @HeartandSoul i know that but i don't want to do the prefixe or suffix ialready know that it just makes a color near the playersname i want the players name to be colored
     
Thread Status:
Not open for further replies.

Share This Page