TagAPI - Change/color the name over people's heads!

Discussion in 'Resources' started by mbaxter, Sep 6, 2012.

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

    CorruptedHelix

    TagAPI is exactly what the name implies; an API. Another plugin has to do that.
     
  2. Offline

    Blixion

  3. Offline

    Gravity

    You don't call it, you listen for it. When the TagAPI plugin exists on the server it calls the events.
     
    mbaxter likes this.
  4. Offline

    finalblade1234

    Gravity
    Oh Great thanks works perfectly
     
  5. Offline

    joehot2000

    Woot! re-visited this! Just made it so all players on Endcraft get randomly coloured name tags! Keep up the good work :D
     
  6. Offline

    egimfun

    i am having a problem with this api. at first i thought it was the NameTags plugin but then i tried colorme and it happened again...
    Whenever someone is pvping and gets killed, when they respawn they have a green name(the &a one) and i cant change this... no matter what rank they are, they respawn with a green name and its very annoying, any reason why its happening?
     
  7. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı

    One of your plugins is telling TagAPI it wants to be green?
     
  8. Offline

    ziimzy

    Im confused! Ok so I have:

    @EventHandler
    public void onNameTag(PlayerReceiveNameTagEvent event) {
    Player player = event.getNamedPlayer();
    event.setTag(ChatColor.RED + player.getDisplayName());
    }

    and then I have:

    if(sender instanceof Player) {
    if (commandLabel.equalsIgnoreCase("nametagapi")) {
    TagAPI.refreshPlayer(player);

    }
    }

    So this should Refresh the nametag is I type /nametagapi? And then I see the player refresh but their name tag is still white!
     
  9. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı

    Handled over IRC
     
  10. Offline

    ziimzy

    I did it :D Thanks guys <3
     
  11. Offline

    Bradley Hilton

    In the next release of CaptureThePoints it will be using this to color player name's based upon which team they are on.
     
  12. Offline

    AppleMan88

    Where would I put a code like this? Under what file or folder?
    The one that would change my name to red for everyone.
    1. @EventHandler
    2. public void onNameTag(PlayerReceiveNameTagEvent event) {
    3. if (event.getNamedPlayer().getName().equals("AppleMan88")) {
    4. event.setTag(ChatColor.RED + "AppleMan88");
     
  13. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı

    You'd put it in a class file that you then register the event for.
     
  14. Offline

    AppleMan88

    I don't quite understand since I'm a noob at this plugin stuff, where would the class file go and how do you make a class file?
     
  15. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı

    Learn more about plugin development first :)
     
  16. Offline

    AppleMan88

    Alright, any recommendations on places to learn about this, or just search it up on YouTube? :p
     
  17. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı

  18. Offline

    TomTheDeveloper

    mbaxter Hey, I found a bug

    I wrote a plugin for killstreaks with the scoreboard(SIDEBAR), and it worked, then I wanted use your tagAPI, so I just made an event for it, but when I exported it, you tagAPI worked fine, but my scoreboard dissappeared. So it doesn't work for scoreboards(SIDEBAR-type).
     
  19. Offline

    orsay

    my problem:

    the players only see the new tags if they where death, but i also used:

    for(Player player : Bukkit.getOnlinePlayers()){
    TagAPI.refreshPlayer(player);
    }

    pls help me, how i can fix that
     
  20. Offline

    SniperFodder

    Hokay. Finally pushed out the update that I did that integrates TagAPI into DispNameChanger.
     
  21. This dont work for me. it says that void is an invalid type on the variable of onNameTag

    @EventHandler
    public void onNameTag(PlayerReceiveNameTagEvent event) {
    if (event.getPlayer().getName().equals("thepickageking")) {
    event.setTag(ChatColor.RED + "TIRtalin");
    }
    }

    wat's wrong:confused:
     
  22. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı

    Can you put the entire class on pastebin.com and link it here
     
  23. you mean this?
     

    Attached Files:

  24. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı

    I suspect you forgot to paste the link, there ;)
     
  25. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı

    I looks like you put the method inside onDisable
     
  26. Where do i have to put it
     
  27. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı

    This is a basic java question. I suggest reading some Java tutorials, like the ones available on the Oracle website :)
     
  28. Offline

    SniperFodder

    Debatable. Java tutorials will help, but Understanding how a Bukkit plugin is structured would help as well.

    Sidenote, did you need anything else aside from a notification that I'm using TagAPI in DispNameChanger?
     
  29. Offline

    morshu9001

    This is great, but how do I set a player's tag without changing his skin?
     
Thread Status:
Not open for further replies.

Share This Page