Upload files to "plugins"
This commit is contained in:
parent
e612ff620a
commit
c08eea13ab
5 changed files with 77 additions and 0 deletions
12
plugins/commandError.js
Normal file
12
plugins/commandError.js
Normal file
|
@ -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 };
|
18
plugins/exploit.js
Normal file
18
plugins/exploit.js
Normal file
|
@ -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 };
|
14
plugins/isolatedEval.js
Normal file
14
plugins/isolatedEval.js
Normal file
|
@ -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 };
|
11
plugins/players.js
Normal file
11
plugins/players.js
Normal file
|
@ -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 };
|
22
plugins/tabComplete.js
Normal file
22
plugins/tabComplete.js
Normal file
|
@ -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 };
|
Loading…
Reference in a new issue