Solved Cooldown

Discussion in 'Plugin Development' started by InspectorFacepalm, May 3, 2013.

Thread Status:
Not open for further replies.
  1. So yeah, i'm making a plugin where you do /kit ender you get a stick, when you right click on the ground you will be boosted 4 blocks over the ground, how do I make a cooldown for this? Like the player can only be boosted every 10 seconds when they right click, help would be great, thanks
    I know how to do this, it's just when I do it, there is no cooldown, so if anyone can help, that would be awesome!
        public void onPlayerFly(PlayerInteractEvent event){
    Player player = event.getPlayer();
    if(event.getAction().equals(Action.RIGHT_CLICK_BLOCK) && player.getItemInHand().getType() == Material.STICK){
    player.setVelocity(new Vector(0, 1.2, 0));
    Anyone know how to do this :I

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jun 1, 2016
  2. Offline


  3. Offline


    facepalm Create a cooldown ArrayList and run if statements for whether the player is in it. Then make a Runnable and take them out of ArrayList.
  4. How would I exactly do that =/=
    Sorry i'm not the best at making plugins ;l
  5. Offline


Thread Status:
Not open for further replies.

Share This Page