Is there a way to set a timeout period on a Minecraft client when connecting to a server? This is due to Eclipse debugging

10,663

I know this is 3+ years later but I've been struggling with this myself (Using Intellij Idea instead of Eclipse though) and I've found a solution to this, which I'll post here in case anyone else comes across this. Since the readTimeout was not behaving as I wanted it to do, what I did is the following:

a) To set timeout on the client side:

  • Install Forge for the spigot server version you are developing (You can still join spigot based servers for plugin development).
  • Install RandomPatches mod (allows you to edit hard-coded vanilla minecraft variables)
  • Edit RandomPatches config file (randompatches.toml) and set "read_timeout_seconds" based on your liking (This should only happen for the client-side when debugging a plugin. You should not change it for production servers ofcourse).

b) To set timeout on the server side:

  • Edit spigot.yml file and set "timeout-time" based on your liking. If you only change the client-side, server is going to crash once this value is surpassed and you'll need to start the server again.

c) Voila! Enjoy debugging for as long as you like!

Share:
10,663

Related videos on Youtube

MangoBox
Author by

MangoBox

Updated on June 04, 2022

Comments

  • MangoBox
    MangoBox almost 2 years

    I recently set up Eclipse debugging for developing Bukkit plugins. It's really awesome being able to see what variables are changing and on what breakpoints, but my main concern is, when debugging with clients connected to my test Minecraft server, they timeout. This is due to Eclipse, when encountering a breakpoint, pauses the servers main thread and timeouts the clients after 30 seconds. I've set the server so it doesn't shut down after 60 seconds, but the clients always disconnect. Is there a client-side option to set timeout periods? Or is it embedded in the way TCP packets work? - Or just another workaround to this?

    • LeoColman
      LeoColman over 6 years
      I think you might be able to increase the timeout timer using -Dfml.readTimeout=60 as a JVM argument (increasing from the default 30s to 60s) on the Minecraft Client
    • LeoColman
      LeoColman over 6 years
      Could you check to see if this works to you, so I can bring it to an answer?
    • Draco18s no longer trusts SE
      Draco18s no longer trusts SE over 6 years
      You need breakpoints to pause ALL threads, there's a setting for it, but I'm away-from-dev so I don't remember where it is.
    • LeoColman
      LeoColman over 6 years
      @Draco18s this likely won't work, because you can't pause the client's thread. When you pause the server thread, the client times out!
    • Draco18s no longer trusts SE
      Draco18s no longer trusts SE over 6 years
      @Kerooker Uh... this setting does exactly that. It pauses the whole VM (both the client thread and the server thread).