/*1Make a function that is exported, this will be the "inject function", which is called when loading the plugin into mineflayer.2You can load this plugin into mineflayer in three ways:341.5```6bot.createBot({7plugins: [require('./plugin')]8})9```10112.12```13bot.createBot({14plugins: {15afk: require('./plugin')16}17})18```19203.21```22const bot = bot.createBot()23bot.loadPlugin(require('./plugin'))24```25*/26module.exports = bot => {27/*28Inside the scope of this function, you should do anything you need to with the bot object, like add properties to it, like `bot.afk`,29this function will be called when this plugin is called during the login process30*/31let rotater32let rotated = false33bot.afk = {}3435bot.afk.start = () => {36if (rotater) return37rotater = setInterval(rotate, 3000)38}3940bot.afk.stop = () => {41if (!rotater) return42clearInterval(rotater)43}4445function rotate () {46bot.look(rotated ? 0 : Math.PI, 0)47rotated = !rotated48}49}505152