Added 2 new example chat bots, removed a really old one which was useless.

This commit is contained in:
Milutinke 2022-10-26 21:31:31 +02:00
parent 80e227c3a7
commit 0468bde434
4 changed files with 73 additions and 30 deletions

View file

@ -0,0 +1,22 @@
//MCCScript 1.0
MCC.LoadBot(new AutoLeaveOnLowHp());
//MCCScript Extensions
namespace MinecraftClient.ChatBots
{
public class AutoLeaveOnLowHp : ChatBot
{
private float HEALTH_BOUNDARY = 10.0f; // 10 HP
public override void OnHealthUpdate(float health, int food)
{
if (health <= HEALTH_BOUNDARY)
{
LogToConsole("Leaving because of low HP (Reconnecting in 5 minutes)!");
ReconnectToTheServer(-1, 300); // Disconnect and reconnect after 5 minutes (300 seconds)
}
}
}
}