It would also be cool to have something like, instead of leaving it sends a command instead.
So for example, if I'm auto mining (with Baritone) with autoeat turned on but a monster starts killing me faster than I can heal then autoleave would just send /rtp
to teleport somewhere else and start mining there instead of leaving the server.