Prevent /bukkit: and /minecraft: commands for non-OP players
This commit is contained in:
parent
53fc397536
commit
48e1f93b64
@ -26,6 +26,20 @@ public class CommandModule extends Module
|
||||
super("Commands", plugin);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void preventMe(PlayerCommandPreprocessEvent event)
|
||||
{
|
||||
if (event.getMessage().toLowerCase().startsWith("/bukkit")
|
||||
|| event.getMessage().toLowerCase().startsWith("/minecraft"))
|
||||
{
|
||||
if (!event.getPlayer().isOp())
|
||||
{
|
||||
event.getPlayer().sendMessage(F.main("Parser", "Nope, not allowed!"));
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onCommand(PlayerCommandPreprocessEvent event)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user