Can someone give me a code that I can use to check cps of the player. I am making an anti-cheat I have a lot of checks but I can't do this Idk why but it doesn't seem to work. On other threads, the CPS checks are not good for an anti-cheat. And yes I tried it by myself.
@Tecnio You probably want to listen to the PlayerInteractEvent, then check if the hand is the main hand (if you don't it'll be called 1 time for each hand), if so, add 1 to the amount of clicks the player has, then use a BukkitRunnable to remove 1 from it 20 ticks later. I've never made this myself but, i'd imagine that's how it works.