mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Don't attack entities whilst dead
MCC will now not attempt to attack entities if the client is dead
This commit is contained in:
parent
a378089f1b
commit
83852511bc
1 changed files with 17 additions and 12 deletions
|
|
@ -18,6 +18,7 @@ namespace MinecraftClient.ChatBots
|
||||||
private Double attackCooldownSecond;
|
private Double attackCooldownSecond;
|
||||||
private int attackRange = 4;
|
private int attackRange = 4;
|
||||||
private Double serverTPS;
|
private Double serverTPS;
|
||||||
|
private float health = 100;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
|
|
@ -31,23 +32,22 @@ namespace MinecraftClient.ChatBots
|
||||||
|
|
||||||
public override void Update()
|
public override void Update()
|
||||||
{
|
{
|
||||||
if (!AutoEat.Eating)
|
if (AutoEat.Eating | health == 0) return;
|
||||||
|
|
||||||
|
if (attackCooldownCounter == 0)
|
||||||
{
|
{
|
||||||
if (attackCooldownCounter == 0)
|
attackCooldownCounter = attackCooldown;
|
||||||
|
if (entitiesToAttack.Count > 0)
|
||||||
{
|
{
|
||||||
attackCooldownCounter = attackCooldown;
|
foreach (KeyValuePair<int, Entity> a in entitiesToAttack)
|
||||||
if (entitiesToAttack.Count > 0)
|
|
||||||
{
|
{
|
||||||
foreach (KeyValuePair<int, Entity> a in entitiesToAttack)
|
InteractEntity(a.Key, 1);
|
||||||
{
|
|
||||||
InteractEntity(a.Key, 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
attackCooldownCounter--;
|
{
|
||||||
}
|
attackCooldownCounter--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -67,6 +67,11 @@ namespace MinecraftClient.ChatBots
|
||||||
handleEntity(entity);
|
handleEntity(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void OnHealthUpdate(float health, int food)
|
||||||
|
{
|
||||||
|
this.health = health;
|
||||||
|
}
|
||||||
|
|
||||||
public override void OnPlayerProperty(Dictionary<string, double> prop)
|
public override void OnPlayerProperty(Dictionary<string, double> prop)
|
||||||
{
|
{
|
||||||
// adjust auto attack cooldown for maximum attack damage
|
// adjust auto attack cooldown for maximum attack damage
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue