mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Fixed Auto Attack bot (forgot to add a method to a commit before)
Tested on 1.18.2
This commit is contained in:
parent
dc0021d990
commit
b5c4cd7566
1 changed files with 17 additions and 1 deletions
|
|
@ -144,6 +144,22 @@ namespace MinecraftClient.ChatBots
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void OnEntityHealth(Entity entity, float health)
|
||||||
|
{
|
||||||
|
if (!entity.Type.IsHostile())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (entitiesToAttack.ContainsKey(entity.ID))
|
||||||
|
{
|
||||||
|
entitiesToAttack[entity.ID].Health = health;
|
||||||
|
|
||||||
|
if (entitiesToAttack[entity.ID].Health <= 0)
|
||||||
|
{
|
||||||
|
entitiesToAttack.Remove(entity.ID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override void OnEntityMove(Entity entity)
|
public override void OnEntityMove(Entity entity)
|
||||||
{
|
{
|
||||||
shouldAttackEntity(entity);
|
shouldAttackEntity(entity);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue