Checking punch times

Discussion in 'Spigot Plugin Development' started by finnbon, Jun 25, 2015.

  1. Hi people!

    I recently ran into a little problem, and my problem is that I tried to count how many times a player punched. After a certain amount of clicks, a cooldown activates. I tried, but failed horribly. I hope I can get some help here!

    Note: I can't use a config file!!

    - Finn
  2. Do those clicks need to be within a certain time interval? If so that makes this a bit harder.

    Otherwise it feels like it's going to be.. weird. Like me clicking 10 times in 10 minutes is not the same as me clicking 10 times in a second, right?

    In any case, you're going to want a HashMap<UUID, SomeClass> to store player data- at minimum you'd store how many times the player has clicked, and their current cooldown if they're on cooldown.