Bypassing 16 character limit on tab list names?

Discussion in 'Plugin Development' started by Creeper674, Sep 20, 2014.

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

    Creeper674

    Hello!

    I have created a plugin which sets a user's name to a specific colour based upon a permission. However for names 12-14+ characters long, it often breaks and console shows a 'reached 16 character limit' error when they join. This is the code I'm using:

    Code:java
    1. if (p.hasPermission("rank.player")) {
    2. p.setPlayerListName(ChatColor.GREEN + p.getName());
    3. }


    With names that are a colour and bold, I just add bold like this:

    Code:java
    1. if (p.hasPermission("rank.owner")) {
    2. p.setPlayerListName(ChatColor.DARK_RED + "" + ChatColor.BOLD + p.getName());
    3. }


    Any suggestions on how to apply colours and bold without bypassing the character limit? Thanks.
     
  2. Offline

    SmooshCakez

    You can use scoreboard prefixes, those show on the tab list. If you want more than just a prefix, pretty sure you can accomplish tab list names longer than 16 characters using packets.
     
  3. Offline

    caderape

    I don't think you can with the tablist by default. you have to cut the nickname if it's over 14 letters
     
Thread Status:
Not open for further replies.

Share This Page