Advertisement
MiniRoger123

Untitled

Oct 27th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. @EventHandler
  2. public void onPlayerCmd(PlayerCommandPreprocessEvent event) {
  3. boolean Command = plugin.getConfig().getBoolean("Actions.CommandDetector.enabled");
  4. if (Command == true) {
  5. String playername = event.getPlayer().getName();
  6. Player p = event.getPlayer();
  7. String cmd = event.getMessage();
  8. if (plugin.getConfig().getStringList("Actions.CommandDetector.Command-BlackList").contains(event.getMessage())) {
  9. String cant = plugin.getConfig().getString("message.error-command");
  10. String prefix = plugin.getConfig().getString("message.prefix-CommandDetector");
  11. cant.replace("&", "§");
  12. prefix.replace("&", "§");
  13. p.sendMessage(prefix + cant);
  14. String Sonable = plugin.getConfig().getString("sounds.blacklist");
  15. event.setCancelled(true);
  16. p.getWorld().playSound(p.getLocation(), Sound.valueOf(Sonable), 5, 1);
  17. }
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement