1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-06 14:46:32 +02: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:
feildmaster
2011-10-03 03:40:42 -05:00
parent 786dcae29e
commit 9e97c93fa1

View File

@@ -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()));
}