Edit Name Tag above Players without other plugins or loss of skin

Discussion in 'Plugin Development' started by Domi381, Sep 2, 2013.

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

    Domi381

    Hey Guys,

    I wanted to know how to change the name tag above the players head without any other plugin, client modification or loss of skin. I just want the players name to be in a different color. I have been googling and searching through threads for about 1 hour now, and I think it is time to ask here. I know there are a lot of threads with this question, but I bet there is a new version of doing this, because the threads were quite old (~1 year). I just want to know how it is working and I am sure it is possible without the things I have written in the title. I have seen it on the Overcast Network and I didn't have any mods installed, so It must work. You can link me to threads where the best possibility (and newest) is shown, that would be very kind of you.

    Domi381
     
  2. 99% sure it's not possible w/o a client mod (Spout)
     
  3. Offline

    Domi381

    Ya wrong buddy. I had no spout installed:

    [​IMG]

    IP: eu.oc.tc
     
  4. Oh cool. How'd ya do it?
     
  5. Offline

    Domi381

    :D That is the issue. That is not my server it was just for proofing that it works. If I already knew the solution I wouldn't have started this thread.
     
  6. oh, lol. No idea mate
     
  7. Offline

    Gater12

    They are probably using the scoreboard's team set display name thing. Like on Vanilla MineCraft, you would set the team color to red, so when you are on the red team, your name will be colored! By the way, nice avatar!
     
  8. Offline

    DrTURTLE2

    Isn't that scoreboards?
     
  9. Offline

    Domi381

    Yeah your avatar isn't bad either!

    But how can you set the color of a team with bukkit?
     
  10. Offline

    MisterErwin

    Google for TagAPI ;)
     
  11. Offline

    Comphenix

    Use the scoreboard API:
    Code:java
    1. public class ExampleMod extends JavaPlugin implements Listener {
    2. private Scoreboard scoreboard;
    3. private List<Team> teams;
    4.  
    5. // For selecting random teams
    6. private Random rnd = new Random();
    7.  
    8. @Override
    9. public void onEnable() {
    10. scoreboard = getServer().getScoreboardManager().getMainScoreboard();
    11. initializeTeam("red", ChatColor.RED.toString());
    12. initializeTeam("blue", ChatColor.BLUE.toString());
    13. teams = Lists.newArrayList(scoreboard.getTeams());
    14.  
    15. // Register all Bukkit event handlers
    16. getServer().getPluginManager().registerEvents(this, this);
    17. }
    18.  
    19. private void initializeTeam(String teamName, String prefix) {
    20. if (scoreboard.getTeam(teamName) == null) {
    21. scoreboard.registerNewTeam(teamName).setPrefix(prefix);
    22. }
    23. }
    24.  
    25. @EventHandler
    26. public void onPlayerJoin(PlayerJoinEvent e) {
    27. // Randomly assign a team
    28. teams.get(rnd.nextInt(teams.size())).addPlayer(e.getPlayer());
    29. }
    30. }
     
  12. Offline

    Kjordo711

    That server is probably using TabAPI
     
  13. Offline

    AppleNick

    Thats the Overcast Network,
    99% sure they use TagAPI, but a majority of their plugins are privately coded by the owners & staff.
    So yeah,
     
  14. Offline

    RainoBoy97

    They do not use TagAPI, I believe they made a function in SportBukkit to color nametags :)
     
    apple nick 4 likes this.
  15. Offline

    Syd

    You can change the color of a nameplate, without losing the skill, but as soon as you change the name itself, you'll lose the skin.
    This is impossible to change without client mod, as skins are handled by the client side.

    The easiest way to implement such functionality is using TagAPI.
    If you don't wanna use TagAPI (what would be kinda useless), you can look at it's source code to find out how to make it yourself.
    (Afair you were able to do such things with Packet20NamedEntitySpawn or so...)
     
  16. Offline

    AppleNick

    Ohh yeah! :D
    I knew it was something custom :) Overcast network is the best! :)
     
    RainoBoy97 likes this.
  17. Offline

    ISHLCMinecraft

    Minecraft supporting colors in nametags. You can change players nametag color with a code using Packets and some other things. So: You can change players nametag's color, but not the name itself.
     
Thread Status:
Not open for further replies.

Share This Page