AutoBroadcast

Discussion in 'Spigot Plugin Development' started by JordanDev, May 27, 2016.

  1. Hello, Im currently working on a plugin and I want the series of broadcasts to start with a command, then stop after the last message
     
    #1 JordanDev, May 27, 2016
    Last edited: Jan 8, 2019
  2. Code (Text):
    String msg = (String) messages.get(ran.nextInt(messages.size()));
    You could just make a variable x and set it to 0, then do messages.get(1 + x). In run(), add 1 to x every cycle and when 1 + x is equal to messages.size(), stop the scheduler.

    EDIT: A.K.A make a for loop :)
     
    #2 Cosmicluck, May 27, 2016
    Last edited: May 27, 2016
  3. Thanks i will try it out