Waiting before doing something again

Discussion in 'Plugin Development' started by Lightzaver, Aug 7, 2013.

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

    Lightzaver

    Hi all- I've been developing a bukkit plugin / minigame called "MCHidden" and i've gotten a bit of it done, except i'm trying to add a part which when an arraylist ( called inlobby in my plugin ) reaches a certain number, it tp's everyone in the arraylist to a set location. Any help would be great, because I can't think of how do this. ( I've tried if inlobby.equals(5) but that doesn't seem to work ) Solved > if (inlobby.size() >= 5) {
    // teleport players
    }

    But I want to know how to make it wait before checking again.
     
  2. Offline

    Stevenpcc

    You need to use this instead

    Code:
    if (inlobby.size() >= 5) {
    // teleport players
    }
    equals doesn't check the size, it takes an object and checks if it's the same as the array. Not what you want at all.
     
  3. Offline

    Lightzaver

    Stevenpcc Thanks i'll try that now. How would you get the plugin to wait before checking again?

    bump.

    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