diff --git a/commands/refill.js b/commands/refill.js new file mode 100644 index 0000000..6f37f1d --- /dev/null +++ b/commands/refill.js @@ -0,0 +1,14 @@ +const desc = "refills the core"; +const usages = " - refill"; +const trustLevel = 0; + +function inject (client) { + const command = (() => { + client.cmdCore.refillCmdCore(); + client.bcraw("Refilled core."); + }) + client.runCommand = command; + return command; +} + +module.exports = { inject, desc, usages, trustLevel }; \ No newline at end of file diff --git a/commands/servereval.js b/commands/servereval.js new file mode 100644 index 0000000..f71bf09 --- /dev/null +++ b/commands/servereval.js @@ -0,0 +1,22 @@ +const desc = "eval code"; +const usages = " - servereval <code>"; +const trustLevel = 2; +const { inspect } = require("util"); + +function inject (client) { + const command = ((args) => { + if (args.slice(1).join(" ")) { + try { + client.tellraw("@a", { text: inspect(eval(args.slice(1).join(" "))) }); + } catch (err) { + client.tellraw("@a", { text: err.toString(), color: "red" }); + } + } else { + client.cmdError("Expected code"); + } + }) + client.runCommand = command; + return command; +} + +module.exports = { inject, desc, usages, trustLevel }; \ No newline at end of file diff --git a/commands/whoami.js b/commands/whoami.js new file mode 100644 index 0000000..89153e1 --- /dev/null +++ b/commands/whoami.js @@ -0,0 +1,16 @@ +const desc = "displays your username and uuid"; +const usages = " - whoami"; +const trustLevel = 0; + +const config = require("../config.json"); +const ChatMessage = require("prismarine-chat")(config.version); + +function inject (client, packet) { + const command = (() => { + client.bcraw(`${config.publicColor}Username: ${new ChatMessage(JSON.parse(packet.senderName)).toMotd().replaceAll("ยง", "&").replaceAll("&r", "&f")}\n${config.publicColor}UUID: ${config.trustedColor}${packet.sender}`); + }) + client.runCommand = command; + return command; +} + +module.exports = { inject, desc, usages, trustLevel }; \ No newline at end of file