mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-09-06 10:26:22 +00:00
Never give our user object to other plugins!
This commit is contained in:
parent
cf7da7a83f
commit
9bd0c33fef
|
@ -16,7 +16,7 @@ public class Commandsuicide extends EssentialsCommand
|
|||
@Override
|
||||
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
|
||||
{
|
||||
EntityDamageEvent ede = new EntityDamageEvent(user, EntityDamageEvent.DamageCause.SUICIDE, 1000);
|
||||
EntityDamageEvent ede = new EntityDamageEvent(user.getBase(), EntityDamageEvent.DamageCause.SUICIDE, 1000);
|
||||
server.getPluginManager().callEvent(ede);
|
||||
user.damage(1000);
|
||||
user.setHealth(0);
|
||||
|
|
Loading…
Reference in a new issue