Colored tag above head

Discussion in 'Plugin Development' started by Rowinvd, Mar 15, 2015.

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

    Rowinvd

    How can i add a colored tag above a player when he got the permission?
    Something like
    If player has permission ...
    Set the nametag to Red
     
  2. Offline

    Ruptur

  3. Offline

    Rowinvd

    @Ruptur When i do p.getDisplayName it will change everyones name to the name i setted
     
  4. Offline

    Ruptur

  5. Offline

    Kilorbine

    Whut?
    How is this possible?!
    Can you past the code pls?
     
  6. Offline

    Ruptur

    @Kilorbine
    You click the link to the tutorial page, and there you can see detailed explainations and examples on how to use tagapi

    Code:java
    1.  
    2. @EventHandler
    3. public void onNameTag(AsyncPlayerReceiveNameTagEvent event) {
    4. if (event.getNamedPlayer().getName().equals("TnTBass")) {
    5. event.setTag(ChatColor.RED + "TnTBass");
    6. }
    7. }
    8.  

    (Tagh me in future do i receive an alert :p)
     
  7. Offline

    Kilorbine

    @Ruptur : i don't need an extern api to do this xD
    This was for @Rowinvd.
    How a p.getDisplayName() can change the name of every player?!
     
  8. Offline

    Ruptur

    @Kilorbine
    #getDisplayName() returns the player display name not set it
     
  9. Offline

    Kilorbine

    I know, this is whyi'm asking hm how the hell he does that ^^
     
  10. Offline

    JooshYT

    It will be better to use TAGAPI, its really easy to import and saves you alot of time. or you can use the 1.8 scoreboards to change the color.
     
  11. Offline

    Konato_K

    @JooshYT You can use scoreboards since 1.5
     
  12. Offline

    teej107

    @JooshYT 1.8 is not relevant here anyway since this thread is not in the Bukkit Alternatives section!
     
Thread Status:
Not open for further replies.

Share This Page