mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-06 11:24:39 +08:00
Check health is 0 after /suicide
This commit is contained in:
parent
2b0506de77
commit
208d673c2b
@ -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()));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user