Spawning Players Randomly

Discussion in 'Plugin Development' started by r0306, Jun 26, 2013.

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

    r0306

    I need to spawn players at random locations within an arena filled with buildings and houses (basically it's a town and yes, there will be different arenas). I want to spawn them so that no player will be spawned within a 20 block radius of another player. How would I do this while making sure that players are not spawned on top of buildings or anywhere other than the ground?
     
  2. Offline

    Enrux

  3. Offline

    r0306

    Enrux
    Thanks for the reply but that isn't quite what I'm aiming to do. I need to actually determine which locations are valid (not stuck inside a building or not on top of a building) which I don't think RandomSpawn does.
     
  4. Offline

    dillyg10

    Mmm, this is quite a bit of logic, basically you should go about it like this

    loop:
    random number between the corners
    if it is in 20 blocks on a player, repeat
    if the block above it isn't air, repeat

    how you translate that to code, is your job dude :p.
     
Thread Status:
Not open for further replies.

Share This Page