mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-29 13:04:59 +00:00
Fix AutoEat crash (#1068)
* Fix AutoEat keep eating after player dead * Fix null reference on GetInventory method * Add error handle for ChatBot API events * Fix minor mistakes
This commit is contained in:
parent
09bfe92071
commit
ab05d697ef
3 changed files with 72 additions and 6 deletions
|
|
@ -34,6 +34,7 @@ namespace MinecraftClient.ChatBots
|
|||
|
||||
public override void OnHealthUpdate(float health, int food)
|
||||
{
|
||||
if (health <= 0) return; // player dead
|
||||
if (((food <= HungerThreshold) || (food < 20 && health < 20)) && !Eating)
|
||||
{
|
||||
Eating = FindFoodAndEat();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue