Randoms Spawns Variable

Discussion in 'Plugin Development' started by blazee15, Oct 25, 2012.

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

    blazee15

    So I'm kinda lost with random spawns inside a variable.

    When onPlayerJoin gets called I want to make it so the player will spawn at a random coordinates that was specified in the variable

    For example, new getLocation(get.World("World"), -1, -1, -1);

    But there will be 3 different coordinates and when the player spawns it will send them to any of those three coordinates.

    Been trying to figure this out for a while but I can't find the key for some reason.
     
  2. Offline

    cman1885

    So have a list of different spawn points and do, on join,

    Random rand = new Random();
    e.getPlayer().teleport(list.get(rand.nextInt(list.size())-1))
     
  3. Offline

    blazee15

    Yeah but how will I actually define the coordinates for it?
     
  4. Offline

    cman1885

    You did that in your original post?
     
  5. Offline

    blazee15

    Okay I'm completely lost, could you maybe give me a example of 2 different coordinates spawn and that will help a lot.
     
Thread Status:
Not open for further replies.

Share This Page