diff --git a/MinecraftClient/ChatBots/AutoAttack.cs b/MinecraftClient/ChatBots/AutoAttack.cs index 8cd8ee2f..9225e370 100644 --- a/MinecraftClient/ChatBots/AutoAttack.cs +++ b/MinecraftClient/ChatBots/AutoAttack.cs @@ -33,6 +33,9 @@ namespace MinecraftClient.ChatBots [TomlInlineComment("$ChatBot.AutoAttack.Interaction$")] public InteractType Interaction = InteractType.Attack; + [TomlInlineComment("$ChatBot.AutoAttack.Attack_Range$")] + public double Attack_Range = 4.0; + [TomlInlineComment("$ChatBot.AutoAttack.Attack_Hostile$")] public bool Attack_Hostile = true; @@ -52,6 +55,12 @@ namespace MinecraftClient.ChatBots LogToConsole(BotName, Translations.bot_autoAttack_invalidcooldown); Cooldown_Time.value = 1.0; } + + if (Attack_Range < 1.0) + Attack_Range = 1.0; + + if (Attack_Range > 4.0) + Attack_Range = 4.0; } public enum AttackMode { single, multi }; @@ -108,6 +117,7 @@ namespace MinecraftClient.ChatBots attackHostile = Config.Attack_Hostile; attackPassive = Config.Attack_Passive; + attackRange = Config.Attack_Range; } public override void Initialize() diff --git a/MinecraftClient/Resources/ConfigComments/ConfigComments.Designer.cs b/MinecraftClient/Resources/ConfigComments/ConfigComments.Designer.cs index 8f358c62..068377a5 100644 --- a/MinecraftClient/Resources/ConfigComments/ConfigComments.Designer.cs +++ b/MinecraftClient/Resources/ConfigComments/ConfigComments.Designer.cs @@ -258,6 +258,15 @@ namespace MinecraftClient { } } + /// + /// Looks up a localized string similar to Capped between 1 to 4. + /// + internal static string ChatBot_AutoAttack_Attack_Range { + get { + return ResourceManager.GetString("ChatBot.AutoAttack.Attack_Range", resourceCulture); + } + } + /// /// Looks up a localized string similar to How long to wait between each attack. Set "Custom = false" to let MCC calculate it.. /// diff --git a/MinecraftClient/Resources/ConfigComments/ConfigComments.resx b/MinecraftClient/Resources/ConfigComments/ConfigComments.resx index bd3a27de..8dc6735a 100644 --- a/MinecraftClient/Resources/ConfigComments/ConfigComments.resx +++ b/MinecraftClient/Resources/ConfigComments/ConfigComments.resx @@ -189,6 +189,9 @@ You need to enable Entity Handling to use this bot Allow attacking passive mobs. + + Capped between 1 to 4 + How long to wait between each attack. Set "Custom = false" to let MCC calculate it.