Making random chests.

Discussion in 'Plugin Development' started by feff890, Apr 24, 2015.

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

    feff890

    Ok, so I am making a survival games plugin and in it I have made a method to reset all chests but so far it can only put 1 out of 4 defined items in the chest and it puts them in the first slot. I need to define a list of all items that can appear in the chest in the config then randomize which items go in the chest and randomize the slot that they go in. Can anyone please help?
     
  2. Offline

    Saith1998

    int slot = Inventory.getSize();
    Random r = new Random();
    slot = r.nextInt(slot);
     
    feff890 likes this.
Thread Status:
Not open for further replies.

Share This Page