Plugin's Command
Creating a command on an plugin.
import Command from "../../../src/plugins/Command.js";
const cmd = new Command({
name: "leave",
description: "Left message",
aliases: ["left"],
args: {
min: 1,
max: 1,
},
arguments: [
{
name: "name",
type: "wildcard_target",
optional: false,
},
],
});
cmd.run = () => {
this.api.getLogger().info("[Command] wOW");
};
cmd.runAsPlayer = () => {
this.api.getLogger().info("[Command] wOW");
};
// This will make this command to execute in console and in game.
cmd.execute();
Last updated