i have this
Code:
for(int i = 0; i < 1; i++) {
Server.itemHandler.createGroundItem(c, Key1, getRandX(), getRandY(), 1, c.playerId); //just once?
Server.itemHandler.createGroundItem(c, 18201, getRandX(), getRandY(), 1000, c.playerId);
}
i want it to spawn those only once, but it spawns 33 different piles, does anybody know wtf is wrong?
Code:
public static int getRandX() {
int[] randX = new int[] { 3236, 3229, 3235, 3234, 3227, 3228, 3233 };
return randX[(int) Math.floor(Math.random() * randX.length)];
}
public static int getRandY() {
int[] randY = new int[] { 9313, 9316, 9319, 9312, 9310, 9320, 9314 };
return randY[(int) Math.floor(Math.random() * randY.length)];
}