2022-12-08 05:51:30 -05:00
|
|
|
function inject (bot) {
|
|
|
|
let id = NaN
|
|
|
|
bot.eaglercrash = {
|
|
|
|
on () {
|
|
|
|
if (!isNaN(id)) throw new Error('Eaglercrash is currently enabled')
|
2022-12-26 06:35:11 -05:00
|
|
|
const command = 'minecraft:execute as @a at @s run playsound block.note_block.harp record @a ~ ~ ~ 100000000000000000000000000000000000000 1 0'
|
2022-12-08 05:51:30 -05:00
|
|
|
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 }
|