Want a better Minecraft server? Read about SpigotMC here!
Separate names with a comma.
Discussion in 'Spigot Plugin Development' started by black_, Jun 7, 2017.
What the title asks. Anyway to tell if a player is holding down rightclick?
You could listen to player interact event(s) and check the server tick time and store it in a hashmap for each player. Compare the tick times for any skipped ticks. Skipped ticks should represent they let go of right click. Consecutive ticks means they're either holding it or spam clicking 20+ times a second.
Best I can think of at least.
For right click that could work, but for 1.8 pvp servers that wont work for left click, because 20cps is common in the pvp community
As for the OP, currenty dont have acces to my laptop so I cant help you out there
Hmm, I think I understand. Can you expand a bit on the hashmap.
I think you should check the ticks between interact events when you hold the button and when you spamming it. It will tell you when a player hold or spam.