Minecraft – How to prevent Minecraft from disconnecting me when I’m AFK

minecraft-java-edition

On Minecraft, I have a good AFK machine set up, it's all lit up and covered so I don't die while in it. But there is a problem with it:

When I go AFK, I'd say about half of the time I come back and the screen says "Disconnected" or "Timed Out". This defeats the purpose of an AFK machine, because none of my things load whilst I'm disconnected.

I was wondering if there is a way to eliminate or at least reduce the amount of times that I get logged out while AFK?

NOTE In this situation where I go AFK I am on a multiplayer server.

Best Answer

Assuming you are getting kicked automatically because the server set a "Max AFK time before kick" , this should be relatively easy to solve.

Simply place a trapdoor in front of you and close/open it at the same time as you press F11.

F11 toggles fullscreen, and if you exit fullscreen while holding a key Minecraft will for some reason not detect that you released the key. So basically you're gonna be constantly opening and closing a trapdoor and therefore you will not be kicked.