int rt = randomNumber(0, 6);
Location locationn1 = new Location(X, Y, Z);
Location locationn2 = new Location(X, Y, Z);
Location locationn3 = new Location(X, Y, Z);
Location locationn4 = new Location(X, Y, Z);
Location locationn5 = new Location(X, Y, Z);
Location locationn6 = new Location(X, Y, Z);
if (rt == 1) p.teleport(location1);
if (rt == 2) p.teleport(location2);
if (rt == 3) p.teleport(location3);
if (rt == 4) p.teleport(location4);
if (rt == 5) p.teleport(location5);
if (rt == 6) p.teleport(location6);
public static int randomNumber(int min, int max) {
int rnd = rand.nextInt((max - min) + 1) + min;
return rnd;
}