diff --git a/MinecraftClient/Commands/AutoAttack.cs b/MinecraftClient/Commands/AutoAttack.cs new file mode 100644 index 00000000..e9663497 --- /dev/null +++ b/MinecraftClient/Commands/AutoAttack.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace MinecraftClient.Commands +{ + class AutoAttack : Command + { + public override string CMDName { get { return "autoattack"; } } + public override string CMDDesc { get { return "autoattack : Enable/disable auto attack mobs."; } } + + public override string Run(McTcpClient handler, string command) + { + if (hasArg(command)) + { + string state = getArg(command); + if (state.ToLower() == "on") + { + if (!handler.AutoAttack) + { + handler.AutoAttack = true; + return "Auto attack turned on."; + } + else + { + return "Auto attack is on."; + } + }else if (state.ToLower() == "off") + { + if (handler.AutoAttack) + { + handler.AutoAttack = false; + return "Auto attack turned off."; + } + else + { + return "Auto attack is off."; + } + } + return ""; + } + else return CMDDesc; + } + } +} diff --git a/MinecraftClient/MinecraftClient.csproj b/MinecraftClient/MinecraftClient.csproj index 82f2fd5d..54e9e3ad 100644 --- a/MinecraftClient/MinecraftClient.csproj +++ b/MinecraftClient/MinecraftClient.csproj @@ -79,7 +79,6 @@ - @@ -87,6 +86,7 @@ +