Posted October 6, 20213 yr comment_63110 Hey everyone. I bet all of you have come across the need to select a random item from a group before. You'll see this in many areas of your server. Most prominently in your mystery / donator box files, raid rewards and crystal chest too! An example of an item group is: This is the hidden content, please Sign In or Sign Up Now, we have a group that includes two items. The most common way of selecting a random reward (You'll see this EVERYWHERE) is; This is the hidden content, please Sign In or Sign Up This will work. However, it's ugly! There are always ways to improve. Here is a new method for you.. I've added mine into Misc.java. This is the hidden content, please Sign In or Sign Up Now, lets select a random item from our group using this new method! (If added in Misc.java) This is the hidden content, please Sign In or Sign Up How much cleaner is that! You can then use the item however you want. E.g. This is the hidden content, please Sign In or Sign Up Thank you!
Create an account or sign in to comment