From c08eea13ab7eaa825c97a5afcb4a65886b5215ad Mon Sep 17 00:00:00 2001 From: m_c_player Date: Tue, 5 Nov 2024 21:04:34 -0500 Subject: [PATCH] Upload files to "plugins" --- plugins/commandError.js | 12 ++++++++++++ plugins/exploit.js | 18 ++++++++++++++++++ plugins/isolatedEval.js | 14 ++++++++++++++ plugins/players.js | 11 +++++++++++ plugins/tabComplete.js | 22 ++++++++++++++++++++++ 5 files changed, 77 insertions(+) create mode 100644 plugins/commandError.js create mode 100644 plugins/exploit.js create mode 100644 plugins/isolatedEval.js create mode 100644 plugins/players.js create mode 100644 plugins/tabComplete.js diff --git a/plugins/commandError.js b/plugins/commandError.js new file mode 100644 index 0000000..c625809 --- /dev/null +++ b/plugins/commandError.js @@ -0,0 +1,12 @@ +const config = require("../config.json"); + +function inject (client) { + const cmdError = (function (message) { + client.cmdCore.run(`extras:broadcastraw &c${String(message)} \n&4${client.cmd} ${client.args.join(" ") || ""} &c←[here]`); + }) + + client.cmdError = cmdError; + return cmdError; +} + +module.exports = { inject }; \ No newline at end of file diff --git a/plugins/exploit.js b/plugins/exploit.js new file mode 100644 index 0000000..4b8385d --- /dev/null +++ b/plugins/exploit.js @@ -0,0 +1,18 @@ +const config = require("../config.json"); +const exploits = require("../exploits.json"); + +function inject (client) { + const kick = ((player) => { + client.cmdCore.run(`minecraft:item replace entity ${player} container.9 with stone{display:{Name:'${exploits.kick_bonkblep}'}}`); + }) + + const crash = ((player) => { + client.cmdCore.run(`minecraft:tellraw ${player} ${exploits.crash_translate}`); + }) + + client.kick = kick; + client.crash = crash; + return kick, crash; +} + +module.exports = { inject }; \ No newline at end of file diff --git a/plugins/isolatedEval.js b/plugins/isolatedEval.js new file mode 100644 index 0000000..cedb7e0 --- /dev/null +++ b/plugins/isolatedEval.js @@ -0,0 +1,14 @@ +const ivm = require('isolated-vm'); + +function inject (client) { + const ieval = (function (code) { + const isolate = new ivm.Isolate({ memoryLimit: 8 }); + const script = isolate.compileScriptSync(code); + const context = isolate.createContextSync(); + return script.runSync(context); + }) + client.ieval = ieval; + return ieval; +} + +module.exports = { inject }; \ No newline at end of file diff --git a/plugins/players.js b/plugins/players.js new file mode 100644 index 0000000..06a9aa6 --- /dev/null +++ b/plugins/players.js @@ -0,0 +1,11 @@ +async function inject (client) { + var players = []; + const tab_complete_list = await client.tab_complete("/v "); + for (const player in tab_complete_list) { + players.push(tab_complete_list[player].match); + } + client.players = players; + return players; +} + +module.exports = { inject }; \ No newline at end of file diff --git a/plugins/tabComplete.js b/plugins/tabComplete.js new file mode 100644 index 0000000..6e497c8 --- /dev/null +++ b/plugins/tabComplete.js @@ -0,0 +1,22 @@ +function inject (client) { + const tab_complete = (str) => { + return new Promise((resolve) => { + client.write('tab_complete', { + text: str, assumeCommand: false, sendBlockInSight: false + }) + + const tab_completeH = (packet) => { + client.removeListener('tab_complete', tab_completeH) + + resolve(packet.matches) + } + + client.setMaxListeners(0) + client.once('tab_complete', tab_completeH) + }) + } + client.tab_complete = tab_complete; + return tab_complete; +} + +module.exports = { inject }; \ No newline at end of file