Check health is 0 after /suicide

This commit is contained in:
KHobbits 2013-03-16 08:42:24 +00:00
parent 2b0506de77
commit 208d673c2b

View File

@ -19,8 +19,12 @@ public class Commandsuicide extends EssentialsCommand
EntityDamageEvent ede = new EntityDamageEvent(user.getBase(), EntityDamageEvent.DamageCause.SUICIDE, Short.MAX_VALUE);
server.getPluginManager().callEvent(ede);
user.damage(Short.MAX_VALUE);
if (user.getHealth() > 0)
{
user.setHealth(0);
}
user.sendMessage(_("suicideMessage"));
user.setDisplayNick();
ess.broadcastMessage(user,_("suicideSuccess", user.getDisplayName()));
ess.broadcastMessage(user, _("suicideSuccess", user.getDisplayName()));
}
}