How can I AFK "click" in Minecraft post 1.13

This solution is not Minecraft specific; it uses the external tool "Auto Hotkey" to emulate clicks

For any auto-clicking, or any keyboard emulation behaviour - I'd recommend looking at AutoHotkey (AHK).

This is a 3rd party program for Windows, which allows you to emulate any number of keyboards and mice, and programmatically control them. Due to it's prevelance, most tasks you wish to accomplish have already been solved and shared online.

There is a usage guide on their official site, for how to install AHK and how to create the auto-clicking scripts you need: https://autohotkey.com/docs/Tutorial.htm

Please note, as with any 3rd party software - usage is at your own risk.


For the autoclicking script itself, here is a simple example:

toggle = 0
#MaxThreadsPerHotkey 2

F8::
    Toggle := !Toggle
    While Toggle{
        Click
        sleep 100
    }
return

The effect is, once the key "F8" is pressed; AHK will begin looping the Click action. Once the F8 key is pressed again, the value of "Toggle" is reset, and the loop ends. It allows you to turn on and off the clicking. There are of course, much more complex auto-clicking techniques you can employ using AHK.

Using online tutorials and searching, I'm sure you will be able to tailor this to your needs. Otherwise, specific AHK scripting questions can be answered on StackOverflow.SE


As Henry Statitovski has pretty much already said, the best way to do this is to:

  1. Hold down right-click on the mouse.
  2. Press F3+T (FN+F3+T for some users)
  3. Before it finishes loading, Alt+Tab out of the window and let go of the right mouse button. Once it has loaded then you can tab in and out freely.

One crucial bit of information is that "pauseOnLostFocus" must be "false" to prevent the game from pausing when Alt+Tabing. This can be toggled in-game by doing F3+P (FN+F3+P for some users)


In 1.14, there is a way to afk fish that means you can alt-tab out. You point and press with the mouse, and then unplug the mouse. This provides an autoclick that will work as an afk fisher. However, if you want to then leave Minecraft, you can reload the texture packs, (fn + F3 + T for Windows, cmd + fn + F3 + T for Mac) and then, while the packs are reloading, alt-tab out. Then, you can alt-tab in and out, no issues. Minecraft will still believe you are clicking, when in reality, you can be playing another game, or watching YouTube, or really anything else. In fact, I just did this while typing out this answer.