From 443f4874df8608d56ccfb106d1e06495cc67d4af Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Apr 2026 13:46:57 +0000 Subject: [PATCH 1/2] Suppress duplicate active effect notifications Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/8649d41a-e2aa-4fdd-aee8-96f4b35c9be0 Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com> --- MinecraftClient/McClient.cs | 43 +++++++++++++------ .../ConfigComments/ConfigComments.resx | 3 ++ MinecraftClient/Settings.cs | 3 ++ 3 files changed, 37 insertions(+), 12 deletions(-) diff --git a/MinecraftClient/McClient.cs b/MinecraftClient/McClient.cs index dc76441b..3ba651a5 100644 --- a/MinecraftClient/McClient.cs +++ b/MinecraftClient/McClient.cs @@ -741,7 +741,7 @@ namespace MinecraftClient if (!playerEffects.Remove(effect, out var effectData)) continue; - ConsoleIO.WriteLine(string.Format(Translations.bot_effect_expired, effectData.GetDisplayName())); + AnnouncePlayerEffectExpired(effectData); if (entities.TryGetValue(playerEntityID, out var playerEntity)) playerEntity.ActiveEffects.Remove(effect); @@ -3830,6 +3830,33 @@ namespace MinecraftClient DispatchBotEvent(bot => bot.OnEntitySpawn(entity)); } + private static bool ShouldAnnouncePlayerEffectGain(EffectData effectData, EffectData? previousPlayerEffect) + { + if (!Config.Main.Advanced.ShowEffectMessages) + return false; + + return previousPlayerEffect is null + || previousPlayerEffect.IsExpired + || previousPlayerEffect.Amplifier != effectData.Amplifier; + } + + private static void AnnouncePlayerEffectGain(EffectData effectData) + { + if (!Config.Main.Advanced.ShowEffectMessages) + return; + + ConsoleIO.WriteLine(string.Format(Translations.bot_effect_gained, + effectData.GetDisplayNameWithArticle(), effectData.GetInitialDurationText())); + } + + private static void AnnouncePlayerEffectExpired(EffectData effectData) + { + if (!Config.Main.Advanced.ShowEffectMessages) + return; + + ConsoleIO.WriteLine(string.Format(Translations.bot_effect_expired, effectData.GetDisplayName())); + } + /// /// Called when an entity effects /// @@ -3849,16 +3876,8 @@ namespace MinecraftClient playerEffects.TryGetValue(effect, out var previousPlayerEffect); playerEffects[effect] = effectData; - bool shouldAnnounceEffectGain = previousPlayerEffect is null - || previousPlayerEffect.Amplifier != amplifier - || (effectData.IsInfinite && !previousPlayerEffect.IsInfinite) - || (!effectData.IsInfinite && duration > previousPlayerEffect.RemainingTicks + 20); - - if (shouldAnnounceEffectGain) - { - ConsoleIO.WriteLine(string.Format(Translations.bot_effect_gained, - effectData.GetDisplayNameWithArticle(), effectData.GetInitialDurationText())); - } + if (ShouldAnnouncePlayerEffectGain(effectData, previousPlayerEffect)) + AnnouncePlayerEffectGain(effectData); } if (entity is not null) @@ -3886,7 +3905,7 @@ namespace MinecraftClient removedEffectData ??= playerEffectData; if (entityid == playerEntityID && removedEffectData is not null) - ConsoleIO.WriteLine(string.Format(Translations.bot_effect_expired, removedEffectData.GetDisplayName())); + AnnouncePlayerEffectExpired(removedEffectData); if (entity is not null) DispatchBotEvent(bot => bot.OnRemoveEntityEffect(entity, effect)); diff --git a/MinecraftClient/Resources/ConfigComments/ConfigComments.resx b/MinecraftClient/Resources/ConfigComments/ConfigComments.resx index 4ff326dd..ff52ffe3 100644 --- a/MinecraftClient/Resources/ConfigComments/ConfigComments.resx +++ b/MinecraftClient/Resources/ConfigComments/ConfigComments.resx @@ -735,6 +735,9 @@ Usage examples: "/tell <mybot> connect Server1", "/connect Server2" Show inventory layout as ASCII art in inventory command. + + Show chat notifications when your active effects are gained or expire. Set to false to disable these messages entirely. + Show full effect names and levels in the TUI status bar instead of compact effect icons only. diff --git a/MinecraftClient/Settings.cs b/MinecraftClient/Settings.cs index c4b264f2..73d0d4db 100644 --- a/MinecraftClient/Settings.cs +++ b/MinecraftClient/Settings.cs @@ -817,6 +817,9 @@ namespace MinecraftClient [TomlInlineComment("$Main.Advanced.show_inventory_layout$")] public bool ShowInventoryLayout = true; + [TomlInlineComment("$Main.Advanced.show_effect_messages$")] + public bool ShowEffectMessages = true; + [TomlInlineComment("$Main.Advanced.show_effect_names_in_tui$")] public bool ShowEffectNamesInTUI = false; From 4bd0929ebf894ea534bd2d99b572f73ce137914b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Apr 2026 14:27:00 +0000 Subject: [PATCH 2/2] Document ShowEffectMessages setting Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/88621e8e-27e0-4be5-9259-efcdf8730704 Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com> --- docs/guide/configuration.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/guide/configuration.md b/docs/guide/configuration.md index acb1ba55..1cb03726 100644 --- a/docs/guide/configuration.md +++ b/docs/guide/configuration.md @@ -503,6 +503,18 @@ Coordinate = { x = 145, y = 64, z = 2045 } - **Default:** `true` +#### `ShowEffectMessages` + +- **Description:** + + This setting controls whether MCC prints messages when one of your active effects is gained or expires. + + Set it to `false` if a beacon or another repeated effect source is spamming the console. + +- **Type:** `boolean` + +- **Default:** `true` + #### `ShowEffectNamesInTUI` - **Description:**