Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void onPlayerCmd(PlayerCommandPreprocessEvent event) {
- boolean Command = plugin.getConfig().getBoolean("Actions.CommandDetector.enabled");
- if (Command == true) {
- String playername = event.getPlayer().getName();
- Player p = event.getPlayer();
- String cmd = event.getMessage();
- if (plugin.getConfig().getStringList("Actions.CommandDetector.Command-BlackList").contains(event.getMessage())) {
- String cant = plugin.getConfig().getString("message.error-command");
- String prefix = plugin.getConfig().getString("message.prefix-CommandDetector");
- cant.replace("&", "§");
- prefix.replace("&", "§");
- p.sendMessage(prefix + cant);
- String Sonable = plugin.getConfig().getString("sounds.blacklist");
- event.setCancelled(true);
- p.getWorld().playSound(p.getLocation(), Sound.valueOf(Sonable), 5, 1);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement