Message loop

Discussion in 'Plugin Development' started by MineDoubleSpace, Aug 3, 2013.

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

    MineDoubleSpace

    Can someone help me with a message loop,

    Bukkit.broadcastMessage(ChatColor.GREEN + "Welcome to server!")
    Bukkit.broadcastMessage(ChatColor.GREEN + "Enjoy!")

    For an example broadcasting above message every 20 seconds.

    Thanks!

    Anyone?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 3, 2016
  2. Offline

    Seadragon91

    I could write the whole code, but take a look here: Scheduler
     
  3. MineDoubleSpace
    Code:
    Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(PluginInstance, new Runnable() {
     
        @Override
        public void run() {
            Bukkit.broadcastMessage(ChatColor.GREEN + "Welcome to server!");
            Bukkit.broadcastMessage(ChatColor.GREEN + "Enjoy!");
     
        }
     
    }, 0L, 20 * 20L); // 20 ticks = 1 second.
     
  4. Offline

    MineDoubleSpace



    If you can write the code and send me the code it will be great!
    I new to coding Java Plugins,
     
  5. Offline

    psanker

    ._.

    Now's always a good time to start learning...
     
  6. Offline

    MineDoubleSpace

    Well that's what i'm trying to do :p


    I get an error on "PluginInstance"

    Got it working thanks for help!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 3, 2016
Thread Status:
Not open for further replies.

Share This Page