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

    chasechocolate

    mbaxter Will the source ever be available?
     
  2. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı Retired Staff

    It already is, but why do you want it?
     
  3. Offline

    Sabersamus

    I personally would like it, because I run a server where I created all the plugins myself, and would like to keep it that way, but would like to implement this into my server. So I'd like to create my own version of this.

    Github?
     
  4. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı Retired Staff

    github.com/kittehorg/tagapi

    Note that this code is licensed such that you have to give me credit. You can't just claim you wrote it ;)
     
    chasechocolate likes this.
  5. Offline

    chasechocolate

    mbaxter oh you have a 2nd github? I always thought you had github.com/mbax
     
  6. Offline

    Devil0s

    Thank you so much. :D
    Good job.
    Does it work with normal monster or other npcs?
     
    mbaxter likes this.
  7. Offline

    iKeirNez

    I think its just players.
     
  8. Offline

    lenis0012

    Intresting, but it seems to not change it on world-changing/tp
    could there be a way to change tags form different events?
     
  9. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı Retired Staff

    on world changing and teleporting, the event will fire as necessary. The only time you need the refresh methods is to change a player's tag for someone who can already see them.
     
  10. Offline

    iKeirNez

    mbaxter Is there any possibility you could expand this for disguising as mobs?
     
  11. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı Retired Staff

    How exactly does disguising as mobs relate to the packet that links entity id to String player name?
     
    ZeusAllMighty11 likes this.
  12. Offline

    iKeirNez

    Sorry, my bad! I thought you were resending all packets
     
  13. Offline

    KeybordPiano459

    It may just be me, but wouldn't making someone see Notch everywhere be an awesome way to troll that person? xD
     
  14. Offline

    Scizzr

    Actually, you can hide them. Use §§§§ (4 of the chat color symbols). I found this out the other day when I was playing around with it trying to use it with Citizens. xD
     
    blablubbabc, hawkfalcon and iKeirNez like this.
  15. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı Retired Staff

    I'm confused by what you're asking.
     
  16. Offline

    xXSniperzzXx_SD

    So how would i make this optional? I know it said only get the event if the plugins on, but how would i do that?

    Unless its like make a new listener class, then only import that class if the plugins on
     
  17. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı Retired Staff

    Precisely. Check if the plugin's there, and then initialize the listener if yes.
     
  18. Offline

    ZeusAllMighty11 Retired Staff

    Sorry I'm a bit confused still, when do name packets get sent?
     
  19. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı Retired Staff

    Whenever the server is letting a player know there's a player there. So, when someone comes in from far away, teleports, or joins. And you can trigger it any time with TagAPI to ensure your tags are always as you want.
     
  20. Offline

    ZeusAllMighty11 Retired Staff

    How to 'trigger' ?

    if noted above already, just say
     
  21. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı Retired Staff

    Read the first post ;)
     
  22. Offline

    ZeusAllMighty11 Retired Staff

    I have to relog for changes to take effect, refreshing isn't updating automatically


    Edit: and I have TagAPI.refresh(player);
    where player is the receiver
     
  23. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı Retired Staff

    And that's your problem. Read the documentation :p
     
  24. Offline

    zachoooo

    Is this working with the beta build 1.4.2-R0.2? It doesnt seem to be properly updating tags for me.

    EDIT: Yes I am updating/refreshing it and all Im doing is
    Code:
    event.setTag(ChatColor.BLUE + event.getTag());
    EDIT 2: It only seems to ever update if I log out and then log back in, never when the refresh is called
     
  25. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı Retired Staff

    You should paste some more of your code. My guess is you're calling refresh on yourself instead of the other person.
     
  26. Offline

    zachoooo

    Code:
    for (Player p : Bukkit.getOnlinePlayers()) {
                        ChatManager.sendMessage("The player: " + p.getName() + " is having their tag updated.");
                        TagAPI.refreshPlayer(p);
                    }
    I have that called after every time a "round" is started on my server. All the players are teleported (which should update it anyways right?) and then I call it myself again using that code ^
     
  27. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı Retired Staff

    zachoooo Teleporting and calling refreshplayer on the same tick might cause an issue. Also, if you're teleporting before marking them for what to change nametag color to you might run into the issue of the event firing before you know how to handle the event.
     
  28. Offline

    zachoooo

    This is crazy! I have the code to only set their name to blue and I added a scheduler to update every second. The people keep flashing, but no blue name.
     
  29. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı Retired Staff

    Did you forget to register the event? :p
     
  30. Offline

    zachoooo

    I may not be an advanced java programmer but even I remembered that :p Thanks for the suggestions though, I am trying to narrow down what I could be possibly doing wrong
     
Thread Status:
Not open for further replies.

Share This Page