Sending message to all online players of a faction

Discussion in 'Spigot Plugin Development' started by PurrfectMistake_, Apr 16, 2017.

Thread Status:
Not open for further replies.
  1. ok, so i'm trying to execute some code, where it sends a title / subtitle when their faction gets renamed. i'm so tired, but it looks fine to me, it's throwing these errors: https://pastebin.com/5syYXsgH

    Using: FactionsUUID

    This is the code:

    Code (Text):
          @EventHandler
          public void FactionRename(FactionRenameEvent e)
          {

              FPlayer player = (FPlayer)e.getPlayer();
              ArrayList<Player> online3 = player.getFaction().getOnlinePlayers();
             
              for(Player s : online3){
                  if (!(s == null))
                  {
             String newtag = e.getFactionTag();
             String oldtag = e.getOldFactionTag();
             
             BountifulAPI.sendTitle(s.getPlayer(), Configuration.fadein, Configuration.titletime, Configuration.fadeout, ChatColor.GOLD + "Faction Notice");
             BountifulAPI.sendSubtitle(s.getPlayer(), Configuration.fadein, Configuration.titletime, Configuration.fadeout, ChatColor.YELLOW + "Faction tag has been changed from " + ChatColor.DARK_AQUA + oldtag + ChatColor.YELLOW + " to " + ChatColor.DARK_AQUA + newtag);
          }
              }
          }
     
    • Like Like x 1
Thread Status:
Not open for further replies.