[SKIP_BUILD]Merge pull request #2405 from ReinforceZwei/attack_range

AutoAttack: Add setting for attack range
This commit is contained in:
BruceChen 2023-01-16 14:16:37 +08:00 committed by GitHub
commit d65f69fad4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 0 deletions

View file

@ -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()