Enchoseon/2based2wait

Proxies getting stuck and kicked for afk

coolpilot904 opened this issue · 3 comments

I am letting some of my proxies walk around spawn but they are getting kicked for afk if they get stuck in a 1x2 bedrock hole or in a lava cast. Would it be possible to make the bots constantly jump so they die of hunger before they can get afk kicked? Thank you!

Someone in the mineflayer discord recomended I use this code but I did not know where to put it.
bot.on('spawn', () => {
bot.setControlState('jump', true)
})

A convenient way to anti-afk with jumping is already built-in and can be enabled in your config.json (see: mineflayer.antiAfk.actions) but iirc it doesn't spam jump the way you want. (Though, the breakBlock option may be helpful for giving your accounts something to do when they're in a lavacast.)

To interact with the high-level Mineflayer API, I recommend tweaking the ./util/mineflayer.js file, which already has some boilerplate. The snippet you're probably interested in tweaking is here.

Thank you! Tried making my own node module to do this for me but it did not work, it seems like chatgpt did not do the trick. I will keep looking in to it.