Solved Maximum playerName lenght?

Discussion in 'Plugin Development' started by IkBenHarm, Jan 5, 2014.

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

    IkBenHarm

    this is my first time using tagAPI, so i've changed some of the code of their examples:

    Code:
        @EventHandler(priority = EventPriority.HIGHEST)
        public void onNameTag(PlayerReceiveNameTagEvent event) {
            Player player = event.getNamedPlayer();
            event.setTag(ChatColor.RED + "[ " + getKingdom(player) + " ]" + ChatColor.WHITE + player.getName());
        }
    But when i start my server it says the following:

    Code:
    [15:32:14 ERROR]: [HKingdoms] Plugin HKingdoms v1.0 has failed to register event
    s for class me.ikbenharm.hkingdoms.EventListener because org/kitteh/tag/PlayerRe
    ceiveNameTagEvent does not exist.
    '

    Any solutions?
     
  2. Offline

    BillyGalbreath

    Make sure the server has TagAPI installed. Your plugin.yml should also list TagAPI as a dependency so it loads after TagAPI does.
     
  3. Offline

    Chinwe

    Or if you want your plugin to run without TagAPI (and without coloured names), only register the listener if TagAPI is installed :)
     
  4. Offline

    IkBenHarm

    BillyGalbreath How would i instal tagAPI, just put it in plugins folder? if so, is it possible to load this plugin automaticly in the plugins folder as soon as my plugin starts? So the owner of the server does not have to think about tagAPI.

    How to list tagAPI as a dependency?

    Tnx!

    (Sorry for the many (noob) questions)
     
  5. Offline

    BillyGalbreath

    Yes.
    Unfortunately, no. Well, yes. But no. You could do it, but its against Bukkit rules and your project would not be allowed to be posted.
    Look at the bottom example. There is a [depend] for listing the dependency plugins. -> http://wiki.bukkit.org/Plugin_YAML
     
  6. Offline

    IkBenHarm

    BillyGalbreath
    could you maybe give me an example of how to lead tagAPI before so the owner does not have to think about it.(im not going to post it on bukkit ) :p

    BillyGalbreath
    i have this in config now:

    Code:
    depend: [tagAPI]
    and tagAPI in the plugins folder, getting this error:
    Code:
    [16:00:43 ERROR]: Could not load 'plugins\HKingdoms.jar' in folder 'plugins'
    org.bukkit.plugin.UnknownDependencyException: tagAPI
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 6, 2016
  7. Offline

    Chinwe

    It's case-sensitive, so depend on [TagAPI] instead.
     
  8. Offline

    IkBenHarm

    Chinwe oh

    it indeed worked now. However, i've done the folowing:

    Code:
        @EventHandler(priority = EventPriority.HIGHEST)
        public void onNameTag(PlayerReceiveNameTagEvent event) {
            Player player = event.getNamedPlayer();
            Player player2 = event.getPlayer();
            if(getKingdom(player).equalsIgnoreCase("Hobo")){
                event.setTag(ChatColor.GRAY + "[ " + getKingdom(player) + " ]" + ChatColor.WHITE + player.getName());
            }
            if(getKingdom(player).equalsIgnoreCase("Empire")){
                event.setTag(ChatColor.DARK_PURPLE + "[ " + getKingdom(player) + " ]" + ChatColor.WHITE + player.getName());
            }
            if(!(getKingdom(player).equalsIgnoreCase("Empire")) && !(getKingdom(player).equalsIgnoreCase("Hobo"))
                    && !(playerIsInSameKingdom(player, player2))){
                event.setTag(ChatColor.RED + "[ " + getKingdom(player) + " ]" + ChatColor.WHITE + player.getName());
            }
            if(!(getKingdom(player).equalsIgnoreCase("Empire")) && !(getKingdom(player).equalsIgnoreCase("Hobo"))
                    && (playerIsInSameKingdom(player, player2))){
                event.setTag(ChatColor.GREEN + "[ " + getKingdom(player) + " ]" + ChatColor.WHITE + player.getName());
            }
        }
    and not the whole name, is this minecraft or is there a solution?

    So basicly my question is:

    is there a max to playernames lenght? If so can you change this value?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 6, 2016
  9. Offline

    bobacadodl

    Yes, there's a max length, its either 15 or 16 characters IIRC. And no, you can't change it :(
     
  10. Offline

    IkBenHarm

  11. Offline

    SzymonOwca


    Anyone know how to do that using teams from Scoreboards (not TagAPI)?
     
  12. Offline

    IkBenHarm

    SzymonOwca
    i have no experience with Scoreboards, im sorry.
     
Thread Status:
Not open for further replies.

Share This Page