Lexepi

Untitled

Mar 26th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. @EventHandler
  2. public void onPlayerSendMessage(AsyncPlayerChatEvent e){
  3. Player p = e.getPlayer();
  4. String msg = e.getMessage();
  5. for(int players = 0; players < Bukkit.getOnlinePlayers().size(); players++){
  6. Player player = Poke.players.get(players);
  7. if(player != null) {
  8. if (msg.contains(player.getName())) {
  9. player.getWorld().playSound(player.getLocation(), Sound.BLOCK_ANVIL_BREAK, 1, 1);
  10.  
  11. }
  12. }
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment