Remove player from a list.

Discussion in 'Plugin Development' started by MinecraftMart, Feb 22, 2015.

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


    So with this code i add a player to a list.
    Map<UUID, String> players = new HashMap<UUID, String>();
    //Game refers to another class.
    game.players.put(p.getUniqueId(), arenaName);
    Then with this code i remove the player from the list on death
    for (Entry<UUID, String> entry : players.entrySet())
    But when i run the start code it still takes the player even tho i removed it.
    With some debugging i came to the conclusion it didnt take tke player out of the list.
    What do I do?
  2. Offline


    @MinecraftMart If you are getting a ConcurrentModificationException use an iterator.
Thread Status:
Not open for further replies.

Share This Page