Tag on Player List Name

Discussion in 'Plugin Development' started by Aeffy, Oct 28, 2015.

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

    Aeffy

    I would like to know how can I put tag, like [Owner], on player list name without cut the nickname by the middle.
     
  2. Offline

    Scimiguy

    player.setPlayerListName();
    @Aeffy
     
  3. Offline

    oceantheskatr

    @Aeffy @Scimiguy I'm pretty sure the tab list has a 16 character limit regardless though, doesn't it?
     
  4. Offline

    Scimiguy

  5. Offline

    ferrybig

    You can use the scoreboard to put a prefix in front of the player
     
  6. Offline

    Aeffy

    There is some tutorial for this?
     
  7. Offline

    Omel

    I created a class for u :)

    Code:
    package listener;
    
    import org.bukkit.Bukkit;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.EventPriority;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerJoinEvent;
    import org.bukkit.scoreboard.Scoreboard;
    import org.bukkit.scoreboard.Team;
    
    public class JoinTab implements Listener {
    
      Scoreboard board = Bukkit.getScoreboardManager().getMainScoreboard();
      Team t = null;
    
      @EventHandler
      public void onJoin(PlayerJoinEvent e) {
        Player p = (Player) e.getPlayer();
       
    
        if (p.isOp()) {
    
          if (board.getTeam(p.getName()) == null) {
    
            t = board.registerNewTeam(p.getName());
    
          } else {
            t = board.getTeam(p.getName());
    
          }
    
          t.setPrefix("§4");
          t.addPlayer(p);
    
        } else if(!p.isOp()){
    
    if (board.getTeam(p.getName()) == null) {
    
            t = board.registerNewTeam(p.getName());
    
          } else {
            t = board.getTeam(p.getName());
    
          }
    
          t.setPrefix("§e");
          t.addPlayer(p);
    }
    
    
    
     
Thread Status:
Not open for further replies.

Share This Page