Anti spam

Using HashMap feature, like (from internet):

 Map<String, Long> lastMessageTime = new HashMap<String, Long>();

public void onPlayerChat(AsyncPlayerChatEvent event){
String playerName = event.getPlayer().getName();
long lastMessage = this.lastMessageTime.get(playerName);
long currentMessage = System.currentTimeMillis();
long difference = currentMessage - lastMessage;
String convertlong = Long.toString(difference);
int getdifference = Integer.valueOf(convertlong);
if (getdifference < plugin.getConfig().getInt("AntiSpam.AllowedMessageInterval")){
event.getPlayer().sendMessage(ChatColor.DARK_RED + "Message cancelled due to chat spam");

Maybe, with a exponential auto-mute system, like:


word filter
elimination or warning mod

Because having players talk about hacking the game in chat.. isn't very nice.

Or using special character for make chaos.

Age Check

I have no idea how the law work in USA, but in EU is illegal to offer at child chat / webchat / social, if under some age (min 13y, in some state 16y). Every service need to apply, even service based outside EU.