mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
26 lines
859 B
C#
26 lines
859 B
C#
using System.Collections.Generic;
|
|
using Brigadier.NET;
|
|
|
|
namespace MinecraftClient.Commands
|
|
{
|
|
class UseItem : Command
|
|
{
|
|
public override string CmdName { get { return "useitem"; } }
|
|
public override string CmdUsage { get { return "useitem"; } }
|
|
public override string CmdDesc { get { return "cmd.useitem.desc"; } }
|
|
|
|
public override void RegisterCommand(McClient handler, CommandDispatcher<CommandSource> dispatcher)
|
|
{
|
|
}
|
|
|
|
public override string Run(McClient handler, string command, Dictionary<string, object>? localVars)
|
|
{
|
|
if (handler.GetInventoryEnabled())
|
|
{
|
|
handler.UseItemOnHand();
|
|
return Translations.Get("cmd.useitem.use");
|
|
}
|
|
else return Translations.Get("extra.inventory_required");
|
|
}
|
|
}
|
|
}
|