Factions relations

Discussion in 'Spigot Plugin Development' started by iNoXs, May 28, 2016.

  1. Hi !
    i have some problem about getting faction relation and change the tablist tag of the player

    Code (Text):
        for(Player player2 : Bukkit.getOnlinePlayers()){
                   MPlayer p2 = MPlayer.get(player2);
                   Faction faction2 = p2.getFaction();
                   
           
                   if(faction1.getRelationTo(faction2) == Rel.ENEMY){
                       
                        NameTag.SetTag(player2, "§c Enemy ");
                    }
                    if(faction1.getRelationTo(faction2) == Rel.NEUTRAL){
                       
                        NameTag.SetTag(player2, "§f Neutral ");
                    }
                    if(faction1.getRelationTo(faction2) == Rel.ALLY){
                       
                        NameTag.SetTag(player2, "§a Ally ");
                    }
                   
                    if(p2.getRelationTo(faction2) == Rel.MEMBER){
                        NameTag.SetTag(player2, "§bMember ");
                    }
               
           
           
        }
           
            return false;

        }
    }
    Bug : i see me as an ennemy :/

    And also i want to update the tablist every minutes for update relation but i don't know how maybe scheduler ?

    Screen of my bug :
     

    Attached Files:

  2. up ? i Realy need help