Waiting time before executing something

Discussion in 'Plugin Development' started by grasshopperMatt123, Mar 27, 2014.

Thread Status:
Not open for further replies.
  1. Is it possible someone could show me a way to check if the time is less then the time of a variable sort of like this

    public int Time = 100;
    public int TimeNow;
    public boolean On;

    public boolean onCommand(CommandSender s, Command cmd, String commandLabel, String[] args) {
    if(commandLabel.equalsIgnoreCase("Start)) {
    for (On = true; Time > TimeNow;
    then I need some way to add time to timenow in seconds or ticks
     
  2. Offline

    Barinade

    System.currentTimeMillis() is the current system time in milliseconds (since like 1970 or something)

    long start = System.currentTimeMillis();
    if (System.currentTimeMillis() - start > 30000) {
    //30 seconds after start
    }
     
  3. Offline

    Gater12

Thread Status:
Not open for further replies.

Share This Page