I used to have the same problem with WorldEdit's compass tool. Use the HOOK_PLAYER_ANIMATION for that. Here is an example:
function OnPlayerAnimation(a_Player, a_Animation) -- In 1.8.x the left click has a value of 0, while in 1.7.x it's 1 local LeftClickAnimation = (a_Player:GetClientHandle():GetProtocolVersion() > 5) and 0 or 1 if (a_Animation ~= LeftClickAnimation) then return false end DoStuff(a_Player) end function DoStuff(a_Player) -- Do the things endHere is my code from WorldEdit