Note: I've only tried it in 1.16 and 1.8.9, does not work in 1.8.9, but not sure about other later versions.
If I remap the Attack/Destroy or Use Item button (Default left/right mouse button) to another key such as "K" or another letter, when holding the key down, it rapidly clicks at 30cps. With left click this spams a lot of hits, and right click can place blocks super fast or throw 30 snowballs per second, etc.
Thank you for your report!
However, we are already tracking this issue, and this report is a Duplicate of MC-129132, which is a report that has not been resolved yet.
If you want, you can upvote the parent ticket, and enable watching to receive any updates about it - if you believe you have any information that may be important for this issue, please leave a comment on the parent. Please also use the search function in the future to prevent duplicate reports.
Quick Links:
📓 Issue Guidelines – 🛠 Community Support – 📧 Customer Support – ✍️ Feedback and Suggestions – 📖 Game Wiki
💬 Mojira Subreddit – 💬 Mojira Discord