# How to execute code more frequently than once per tick in Minecraft Forge/MCP?

I'm working on a mod for Minecraft in Java. How can I make something happen every half tick? If I run my code in the tick function, my code is called 20 times a second. I want my code to be called 40 times a second, or even 60 or 80. How would I do this?

Any answer, whether in Forge, MCP, or even plain Java would help.

EDIT: I'm still keeping this question up, but the rest of the game only ticks at 20. Doing 1 task at 60 wont make a difference if everything else ticks at 20.

• What is the intent of calling your code more than once? What do you want to do more often than once per tick? Oct 8 '21 at 18:16
• Anything really. The example I had was spamming a mouse button. Like clicking exactly 13 or 14 cps which required more precision than 1 tick. Oct 8 '21 at 18:22
• Let's just assume I have a function called clickMouse() Oct 8 '21 at 18:22
• I'm not sure but, if everything else is running at 20 ticks per second, do you know if the rest of the game will be able to handle your commands more frequently than this? Oct 8 '21 at 20:57
• Oh! I completely didn't think about that! Your absolutely right. If I call something 60 times a second, the game will in fact only process it at 20. Thank you for pointing that out. Oct 8 '21 at 21:01