chomens-bot-js/commands/eaglercrash.js

31 lines
1.1 KiB
JavaScript
Raw Normal View History

2022-08-14 05:51:45 -04:00
/* eslint-disable max-len */
module.exports = {
name: 'eaglercrash',
alias: [],
description: 'Lags Eaglercraft and crashes it',
usage: '<on|off> <hash>',
trusted: 1,
2022-11-16 06:41:30 -05:00
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
2022-11-07 07:26:38 -05:00
if (args[1] === 'on') {
2022-11-16 06:09:37 -05:00
if (args[0] === hash) {
2022-08-14 05:51:45 -04:00
bot.eaglercrashstarted = true;
bot.eaglercrash = setInterval(async function() {
2022-11-07 07:26:38 -05:00
if (bot.eaglercrashstarted === true) return bot.core.run('minecraft:playsound block.note_block.harp record @a ~ ~ ~ 100000000000000000000000000000000000000 1 0');
2022-08-14 05:51:45 -04:00
}, 0);
bot.core.run('minecraft:tellraw @a ["",{"text":"Eaglercrash started","color":"white"}]');
} else {
throw new Error('Invalid hash');
}
}
2022-11-07 07:26:38 -05:00
if (args[1] === 'off') {
2022-11-16 06:09:37 -05:00
if (args[0] === hash) {
2022-08-14 05:51:45 -04:00
clearInterval(bot.eaglercrash);
bot.eaglercrashstarted = false;
bot.core.run('minecraft:tellraw @a ["",{"text":"Eaglercrash stopped","color":"white"}]');
} else {
throw new Error('Invalid hash');
}
}
},
};