events.onTickEnd(() => { if (player.getHealth() < 10) { player.disconnect("", "Low HP"); } if (player.getFood() < 8) { player.disconnect("", "Low food"); } });