Skip to content

Instantly share code, notes, and snippets.

@EricZeiberg
Created January 13, 2014 21:38
Show Gist options
  • Save EricZeiberg/8408674 to your computer and use it in GitHub Desktop.
Save EricZeiberg/8408674 to your computer and use it in GitHub Desktop.
Spawn
for(int i = 0 ; i < 20 ; i++) {
int radius = 30;
int max = 10;
double x = (Math.random() * (max * 2)) - max;
double y = 0;
double z = (Math.random() * (max * 2)) - max;
int x1 = (int) x;
int z1 = (int) z;
double center_x = -17;
int center_z = -13;
if (Math.pow(x - center_x, 2) + Math.pow(z1 - center_z, 2) < Math.pow(radius, 2)){
location.add(x,y,z);
p.teleport(location);
}
else {
x = x-10;
z = z-10;
location.add(x,y,z);
p.teleport(location);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment