Scoreboard prefix colors are quite frustrating...

Discussion in 'Plugin Development' started by caseif, Jul 2, 2013.

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

    caseif

    I'm working on a plugin which must add both text formatting and color to players' names, but I can't seem to get it working. I'd like to have the color stored in the prefix, and the formatting tags added to the OfflinePlayer name used in the actual scoreboard, but this would require to put the formatting before the color, which doesn't seem to work. As I've discovered, I'm unable to use both formatting and color in a prefix, as it will only use one. I'm also unable to use two ChatColors. The only alternative would be to add the formatting separately, but as I mentioned, the color must go first. Can anyone think of a workaround for this?
     
  2. Offline

    Eistee²

    http://dev.bukkit.org/server-mods/color-list/



    This should help you, when you write "§1Text" the word "Text" would be dark blue and the §1 will disappear :) so you can use different chat colors in one message (or it was &1 im not sure currently) thats the way I load colors from the config for my plugin

    Sincerely Eistee²
     
  3. Offline

    caseif

    Eistee² I know how that works, but I can only use that when adding the color manually, as the color must be before the formatting, which is always manually added.
     
  4. Offline

    Eistee²

    I'm not sure if I understood you right but you could check if the player is online or offline store the color in a String and add this to the text? :p
     
  5. Offline

    caseif

    The player will always be online. My issue is, they're either alive, MIA, or dead, which determines the formatting. They're also assigned to a team, which determines the color. I'd like the color, but not the formatting, to be displayed in the player list and the nametag, which would require the color to be stored in the team prefix. However, I cannot add the formatting when setting the player's score, as the color must come first.
     
  6. Offline

    Eistee²

    Okay now I'm a little bit confused :D could you please poste a code snippet so I may can undertand it? :D
     
  7. Offline

    caseif

Thread Status:
Not open for further replies.

Share This Page