From 2b05b7420e72d14920fa746b3089bfca21b2aa7d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 5 Jun 2026 06:23:11 +0000 Subject: [PATCH 1/2] Initial plan From 8757533fb904804475a23ea6b60009796791d255 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 5 Jun 2026 06:29:43 +0000 Subject: [PATCH 2/2] Fix Script bots accumulating on reconnect by unloading on disconnect Script ChatBots were persisted in the static botsOnHold list across reconnects. When ScriptScheduler triggered new scripts on login, the old Script bots were still running, causing duplicate commands to be sent simultaneously. This led to command spam and crashes. Adding OnDisconnect to the Script ChatBot ensures scripts are removed from the bots list before they can be saved to botsOnHold, preventing accumulation of duplicate script instances on reconnect. --- MinecraftClient/ChatBots/Script.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MinecraftClient/ChatBots/Script.cs b/MinecraftClient/ChatBots/Script.cs index bbfe729f..e2bb6636 100644 --- a/MinecraftClient/ChatBots/Script.cs +++ b/MinecraftClient/ChatBots/Script.cs @@ -149,6 +149,12 @@ namespace MinecraftClient.ChatBots } } + public override bool OnDisconnect(DisconnectReason reason, string message) + { + UnloadBot(); + return false; + } + public override void Update() { if (csharp) //C# compiled script