Same MOTD

Discussion in 'Plugin Development' started by MaxNatural, Feb 27, 2015.

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

    MaxNatural

    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");       
            }
           
           
           
        }
        
     
  2. Offline

    teej107

    Datdenkikniet and Konato_K like this.
Thread Status:
Not open for further replies.

Share This Page