Any ideas how I might go about coding a cooldown plugin? Ive been looking at some other plugins with cooldowns, but have come up empty. Any ideas?
Mind expanding on that a little? What I'm trying to do is once you eat food, for which I'm using on playerinteract, with the material pork (better way to do this?), and then what?
Maybe you should do the follow like what you: Do Event playerinteract with material pork Do System.currentTimeMillis() [I have no experience with this, but I'm guessing the steps you do] I think..
When the player manages to eat you store the System.currentTimeMillis() in an integer. Then when he tries to eat again you check if(System.currentTimeMillis() - lastTimeAte > delayInMillis) and then you store the time again. Else you cancel the event. I assume that's what you are trying to do, add a delay between eating. I believe a HashMap<String, Int> would be good for storing the last time they ate. The string would then be the player's name and the integer would be the time they last ate.