So the plugin should test if the block under a player is blue/red wool, and if so it adds them to the config and if not it removes them, but it keeps adding a player continously and when i checked it i saw this: Anyone see why it would keep adding it to the config? Relevant code: Code (Text): public class GameStart implements Listener { Main pl; public GameStart(Main pl){ this.pl = pl; } List<String> red = new ArrayList<String>(); List<String> blue = new ArrayList<String>(); @EventHandler public void onPlayerMove(PlayerMoveEvent event){ TeamData td = new TeamData(pl); FileConfiguration teams = td.getData(); Player p = event.getPlayer(); blue.addAll(teams.getStringList("Teams.Blue")); red.addAll(teams.getStringList("Teams.Red")); if(p.getWorld().getName().equals("world_nether")){ Block b = p.getLocation().getBlock().getRelative(BlockFace.DOWN); if(b.getState().getData() instanceof Wool){ Wool wool = (Wool) b.getState().getData(); DyeColor dc = wool.getColor(); if(dc.toString() == "BLUE"){ if(!teams.contains("Teams.Blue." + p.getName())){ blue.add(p.getName()); if(teams.getStringList("Teams.Blue").contains(p.getName())) teams.set("Teams.Blue", blue); td.saveData(); } }else if(dc.toString() == "RED"){ if(!teams.contains("Teams.Red." + p.getName())){ red.add(p.getName()); if(teams.getStringList("Teams.Red").contains(p.getName())) teams.set("Teams.Red", red); td.saveData(); } } } } }
Just realised this was in your code. Remove the "Teams.Red" part, because you only store the player name in your list