Solved Random spawning from a arraylist

Discussion in 'Plugin Development' started by x_Jake_s, Nov 22, 2016.

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

    x_Jake_s

    So basically i have an arraylist which i have added some spawns to.

    public ArrayList<Location> spawns = new ArrayList<Location>();

    now i want to filter through all of the locations and assign a player to each location so that the spots are filled and each player won't be spawned in the same location. I have a general idea of how to do this but whenever i get ready to write it out i just can't seem to figure it out.
     
  2. Offline

    timtower Administrator Administrator Moderator

    @x_Jake_s Copy the list, assign somebody to the first one, remove the first from the cloned list, repeat.
     
  3. Offline

    x_Jake_s

    ahh okay thats simpler then the method i was trying thank you @timtower
     
    timtower likes this.
Thread Status:
Not open for further replies.

Share This Page