Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void onPlayerChat(PlayerChatEvent chat) {
- String message = chat.getMessage();
- if (message.length() > 3)
- {
- char old[] = message.toCharArray();
- char compare[] = message.toUpperCase().toCharArray();
- int count = 0;
- for (int i=0; i<message.length(); i++)
- {
- if (old[i] == compare[i])
- {
- count = count + 1;
- }
- }
- if (((int)message.length()/100) > 50)
- {
- chat.setCancelled(true);
- Player p = chat.getPlayer();
- p.sendMessage(ChatColor.RED + "Do not send messages in only capital letters." + ChatColor.WHITE + "You have been set on fire for doing this.");
- p.setFireTicks(5000);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment