diff --git a/MinecraftClient/ChatBot.cs b/MinecraftClient/ChatBot.cs
index d362f4a0..d4cdf4da 100644
--- a/MinecraftClient/ChatBot.cs
+++ b/MinecraftClient/ChatBot.cs
@@ -299,6 +299,20 @@ namespace MinecraftClient
///
public virtual void OnInventoryClose(int inventoryId) { }
+ ///
+ /// Called when a player joined the game
+ ///
+ /// UUID of the player
+ /// Name of the player
+ public virtual void OnPlayerJoin(Guid uuid, string name) { }
+
+ ///
+ /// Called when a player left the game
+ ///
+ /// UUID of the player
+ /// Name of the player
+ public virtual void OnPlayerLeave(Guid uuid, string name) { }
+
/* =================================================================== */
/* ToolBox - Methods below might be useful while creating your bot. */
/* You should not need to interact with other classes of the program. */
diff --git a/MinecraftClient/McClient.cs b/MinecraftClient/McClient.cs
index e32c22be..583234d3 100644
--- a/MinecraftClient/McClient.cs
+++ b/MinecraftClient/McClient.cs
@@ -1759,6 +1759,8 @@ namespace MinecraftClient
{
onlinePlayers[uuid] = name;
}
+
+ DispatchBotEvent(bot => bot.OnPlayerJoin(uuid, name));
}
///
@@ -1771,6 +1773,8 @@ namespace MinecraftClient
{
onlinePlayers.Remove(uuid);
}
+
+ DispatchBotEvent(bot => bot.OnPlayerLeave(uuid, onlinePlayers[uuid]));
}
///