Write script to automatically disconnect you based on some conditions.
Use Events Scripting module to check for conditions every game tick. Use player.disconnect(...); for disconnect. Example:
events.onTickEnd(() => {
    if (player.getHealth() < 10) {
        player.disconnect("", "Low HP");
    }
    
    if (player.getFood() < 8) {
        player.disconnect("", "Low food");
    }
});