Random number between 40-80?

Discussion in 'Bukkit Help' started by lockoroko, Jul 10, 2014.

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

    lockoroko

    So right now im making a plugin. And I need to generate a random number between 40 and 80. I tried some google searches but didnt find anything like this. So does anyone here know how to do this? Thanks!
     
  2. Offline

    MrInspector

    Wrong section, I think you're looking for the "Plugin Development" section.
     
  3. Offline

    ZanderMan9

    lockoroko You'll need to use java.util.random. Create a new random object, then use randomObject.nextInt();
    For arguments, use 40... that will give you a random number in a range of 40. Now Java starts on 0's as you know, so figure out how much you need to add to 0 to get the desired effect...
     
Thread Status:
Not open for further replies.

Share This Page