Last active
August 29, 2015 14:18
-
-
Save Cewlt/ee31036d3fdc6a2dff9f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<String> automsgs = getConfig().getStringList("automessages"); | |
Random r = new Random(); | |
public void onEnable() { | |
Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new Runnable() { | |
public void run() { | |
if(!(Bukkit.getOnlinePlayers().size() <= 1)) { | |
String msg = ChatColor.translateAlternateColorCodes('&', automsgs.get(r.nextInt(automsgs.size()))); | |
Bukkit.broadcastMessage(msg); | |
} | |
} | |
}, 0, 1000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment