1.15.2 Random string output from config

Discussion in 'Spigot Plugin Development' started by Phoenix852, Mar 1, 2020.

  1. I want to know if I can get a list of strings from config.yml and output a random string from that in the console. Thank you.
  2. Of course. Get the list and get a random number from 0 to the list size, then print it.
  3. Any code as example? I am not good at java, please help dude
  4. Code (Text):
    Configuration config = // Get your config from somewhere

    List<String> myList = // Use the function in the spigot link I attached.
    Get a random number:

    Code (Text):
    myList.get(x); // Where x is the random number you generated
    #4 yPedx, Mar 1, 2020
    Last edited: Mar 1, 2020
    • Like Like x 1
  5. Still confuses me . Like how? Could you post a code to do this?
  6. Phoenix, yPedx has given you all the means to create what you want, use the tools and learn it, don't ask for the code directly, this isn't going to help you in the future!
  7. I don't want the code directly, it was my internet which didn't load the code that @yPedx provided to me and I said him to provide code without seeing it. But thank you @yPedx for the help.