Solved Restocking chests with customizable items

Discussion in 'Plugin Development' started by oscar.shrimpton.dev, Apr 9, 2014.

Thread Status:
Not open for further replies.
  1. Hi,

    Just like the title says, does anyone know how to restock a chest with items that are customizable in the config? It would also be awesome if there was a way to make certain items rarer and others more common. I already have a method that can scatter an itemstack list in random slots in a chest inventory

    Thanks,

    whatapigdoes
     
  2. Offline

    Zethariel

    You just put them into the chest's inventory. Get the block as a Chest and get it's inventory, add/remove items as you see fit. It's just a regular Array, like all other Inventories.
     
  3. I know how to fill chests i am asking however how to generate a random list of itemstacks
     
  4. Offline

    Zethariel

    Store the desired itemstacks in a list and grab random indexes? That's not really a Bukkit question, more like Java random :p
     
  5. That's what i was doing before but it was only filling up with webs. Fixed now.
     
Thread Status:
Not open for further replies.

Share This Page