This is a tutorial for a hack that when toggled, will disconnect you from a server when you are on two hearts or less. Of course, this will not work if you are on a server with an anti-pvp log plugin.
With this hack you're going to need the player's health. So use the new getHealth for 1.6.2. Use this:
Code:
mc.thePlayer.func_110143_aJ()
Here is how you can use it to your advantage:
Code:
if (Abort && mc.thePlayer.func_110143_aJ() <= 4.0F)
{
this.mc.theWorld.sendQuittingDisconnectingPacket();
(Abort) = false;
}
Player Health is measured in health points, each point being half a heart, so you can easily tune the "4.0F" to your needs, perhaps you could even make a chat command to change how low your health needs to get before you send the disconnect packet.
Make sure you include the bit at the end that turns off the hack afterwards or you will have to restart Minecraft to log into the server that you pvp logged on.
And to say bye, here is a smiley

.