mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-12 04:20:41 +00:00
Fires an event before "killing."
Can be made cancel-able. Could also be written to add "suicide" (if sender == player)
This commit is contained in:
parent
3b9aa445e9
commit
7668af15b0
1 changed files with 4 additions and 0 deletions
|
@ -23,6 +23,10 @@ public class Commandkill extends EssentialsCommand
|
|||
|
||||
for (Player p : server.matchPlayer(args[0]))
|
||||
{
|
||||
EntityDamageEvent ede = new EntityDamageEvent(p, EntityDamageEvent.DamageCause.CUSTOM, 1000);
|
||||
server.getPluginManager().callEvent(ede);
|
||||
//if (ede.isCancelled()) return;
|
||||
|
||||
p.setHealth(0);
|
||||
sender.sendMessage(Util.format("kill", p.getDisplayName()));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue