mindcraft icon indicating copy to clipboard operation
mindcraft copied to clipboard

Dynamic Minecraft version / host port

Open Nimikita opened this issue 1 year ago • 1 comments

Added functionality such that if in settings.js:

  • If "port" is -1, the Minecraft LAN ports are scanned on the host for a LAN server.
  • If "minecraft_version" is set to "auto", it'll use the server version for mcdata and joining.

Changes:

  • Added mcserver.js, responsible for new server-related functionality. (Retrieving a valid server, pinging, and error handling.)
  • mcdata.js now exports a class with mc-related functionality.
  • Host, port, and version are now passed to agent processes and now used instead of settings.js during bot init.
  • Added better error handling for server/version issues:
    • Server not found.
    • Server is using an unsupported Minecraft version. (Then lists compatible versions from minecraft-protocol.)
    • Server doesn't use expected Minecraft version.

Nimikita avatar Nov 14 '24 22:11 Nimikita

@Nimikita I am now getting to this PR. If you update with main I will review.

MaxRobinsonTheGreat avatar Jan 06 '25 18:01 MaxRobinsonTheGreat

I know it has been a while, but if you would like to migrate this PR to Mindcraft-CE, I would be happy to merge this PR! https://github.com/mindcraft-ce/mindcraft-ce

Sweaterdog avatar Jul 09 '25 04:07 Sweaterdog