mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-14 10:44:55 -05:00
22 lines
699 B
JavaScript
22 lines
699 B
JavaScript
function inject (bot) {
|
|
let id = NaN
|
|
bot.eaglercrash = {
|
|
on () {
|
|
if (!isNaN(id)) throw new Error('Eaglercrash is currently enabled')
|
|
const command = 'minecraft:execute as @a at @s run playsound block.note_block.harp record @a ~ ~ ~ 100000000000000000000000000000000000000 1 0'
|
|
bot.cloop.add(
|
|
command,
|
|
0,
|
|
false
|
|
)
|
|
id = bot.cloop.list.findIndex((cloop) => cloop.command === command) // ig not the best way to find the eaglercrash cloop
|
|
},
|
|
off () {
|
|
if (isNaN(id) /* you can't use !id */) throw new Error('Eaglercrash is currently not enabled')
|
|
bot.cloop.remove(id)
|
|
id = NaN
|
|
}
|
|
}
|
|
}
|
|
|
|
module.exports = { inject }
|