Monthly Chests

Discussion in 'Plugin Development' started by AlbkadDev, Sep 12, 2017.

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

    AlbkadDev

    So I am thinking of developing a Monthly chest plugin. Where u open a chest get some items and then can leave. Alot of these things I already know how to do but theres something I dont know how to do. So when the player clicks this item that will randomize into an item. So for example when the player clicks one of the enderchests in the inventory I created, that one will be chosen and roll. Then for another addon to the plugin I need to see when the player has clicked 4 of the ones and then remove the rest slowly. If you do not understand something please tell me so I can fix it/explain it.
     
  2. Offline

    travja

    For removing something on a delay, see Schedulers. As for randomizing an item, you can create an ArrayList of ItemStacks and use Java's Random(Random r = new Random()) to get a random value by using array.get(r.nextInt(array.size())) which will return a random entry from the array.
     
Thread Status:
Not open for further replies.

Share This Page