Solved Random Chest Items

Discussion in 'Spigot Plugin Development' started by Frealy1995, Jun 30, 2016.

  1. Hello,

    I create a world, the world total chest : 10

    How to total chest (10) random items for 10 min to refresh?

    Only random chest logic :) I coded on scheduler.

    Thanks! :D
     
  2. Have a list of all items you want to potentially add to the chests. Use a random number to select a random item from the list. Add the item to the chest.
     
    • Agree Agree x 1
  3. Yes, I search to I find the code.

    And I have a problems

    Code (Text):

    Inventory inv = ((Chest) entities).getInventory();
                               inv.addItem(new ItemStack(Material.GOLDEN_APPLE));
     
    The code working! how to multi item add? inv.setContents(??);

    Thanks :D
     
  4. Use a loop.