Item Cooldowns

Discussion in 'Plugin Requests' started by Tempora, Jul 19, 2017.

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

    Tempora

    Is it possible to add a cool down time to items? Such as potions, Eating, spawneggs and Enderpearls?
     
  2. Offline

    AsnoMigo

  3. Offline

    Machine Maker

    @AsnoMigo That's not a very helpful answer.


    @Tempora Yes it is possible. You can create hash maps for potions, eating, etc, that have the objects, UUID and Integer. When a player does one of things you want a cool down for, add them to the hashmap with the time you want them to wait. Then, in the onEnable method, start a Bukkit Runnable that runs every 1 second, that decreases all the players times by one and removes them from the hashmap. If their time is 0. Than just be sure to check that the player is not in the hashmaps when they use and item.
     
  4. Online

    timtower Administrator Administrator Moderator

  5. Offline

    Machine Maker

    @timtower Wow. I guess I just looked at the question and was like, "Oh, guys trying to make a plugin with this."
     
  6. What items do you want?
     
Thread Status:
Not open for further replies.

Share This Page