AutoAttack: Add setting for attack range

This commit is contained in:
ReinforceZwei 2023-01-10 16:52:18 +08:00
parent 7d3512ef87
commit 640abd2d78
3 changed files with 247 additions and 229 deletions

View file

@ -32,6 +32,9 @@ namespace MinecraftClient.ChatBots
[TomlInlineComment("$ChatBot.AutoAttack.Interaction$")]
public InteractType Interaction = InteractType.Attack;
[TomlInlineComment("$ChatBot.AutoAttack.Attack_Range$")]
public int Attack_Range = 4;
[TomlInlineComment("$ChatBot.AutoAttack.Attack_Hostile$")]
public bool Attack_Hostile = true;
@ -107,6 +110,9 @@ namespace MinecraftClient.ChatBots
attackHostile = Config.Attack_Hostile;
attackPassive = Config.Attack_Passive;
attackRange = Config.Attack_Range;
if (attackRange < 1) attackRange = 1;
if (attackRange > 4) attackRange = 4;
}
public override void Initialize()

File diff suppressed because it is too large Load diff

View file

@ -189,6 +189,9 @@ You need to enable Entity Handling to use this bot
<data name="ChatBot.AutoAttack.Attack_Passive" xml:space="preserve">
<value>Allow attacking passive mobs.</value>
</data>
<data name="ChatBot.AutoAttack.Attack_Range" xml:space="preserve">
<value>Capped between 1 to 4</value>
</data>
<data name="ChatBot.AutoAttack.Cooldown_Time" xml:space="preserve">
<value>How long to wait between each attack. Set "Custom = false" to let MCC calculate it.</value>
</data>