So I tried randoms and they are pretty much 80% the same time and don't switch. Is there a better way to do this? Code: package me.max.events; import java.util.Random; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.server.ServerListPingEvent; public class MOTD implements Listener{ @EventHandler(priority = EventPriority.HIGHEST) public void onServerPingMOTD(ServerListPingEvent e) { Random rand = new Random(); int random = rand.nextInt(2); if(random == 0){ e.setMotd(" Wat?"); } else if(random == 1){ e.setMotd("No h8 8/8"); } else if(random == 3){ e.setMotd(" Hackers not welcome"); } else if(random == 4){ e.setMotd("Gong likes to code"); } else if(random == 5){ e.setMotd(" Much factions"); } else if(random == 6){ e.setMotd("Max has to much time"); } else if(random == 7){ e.setMotd("Fight me"); } else if(random == 8){ e.setMotd(" :D"); } else if(random == 9){ e.setMotd(" We have gigs!"); } else if(random == 10){ e.setMotd(" Pigtamer is pretty cool"); } }
@MaxNatural http://docs.oracle.com/javase/7/docs/api/java/util/Random.html#nextInt(int) Read that and look at the 15th line (one where you obtain a random int). Tell me what you see. Also, your code will be easier to maintain if you put the strings in a List and get a String from the <random number> index.