mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-07 19:40:23 +01: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
|
@Override
|
||||||
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
|
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);
|
server.getPluginManager().callEvent(ede);
|
||||||
user.damage(1000);
|
user.damage(1000);
|
||||||
user.setHealth(0);
|
user.setHealth(0);
|
||||||
|
Loading…
Reference in New Issue
Block a user