@EventHandler(priority = EventPriority.LOWEST)
	public void onchat(AsyncPlayerChatEvent event) {
		if (core.getDB().secplayers.containsKey(event.getPlayer().getName())) {
			SecretPlayer player = core.getDB().secplayers.get(event.getPlayer().getName());
			final String word = event.getMessage();
			if (player.isLoggedIn()) { return; }
			
			// Security fix: Worse case-scenario the message does get broadcasted.
			event.setMessage(Configuration.prefix + " " + ChatColor.RED + "Blocked");
			
			// this event is going to be cancelled. Just set it early.
			event.setCancelled(true);
			
			if (player.threeSecondRule()) { return; }
			
			if (!player.isLoggedIn() && !player.isRegistered()) {
				// register the player.
				// but first, get the word in our string.
				if (word.length() < Configuration.minwordlength) {
					player.getPlayer().sendMessage(Configuration.prefix + ChatColor.RED + "Your secret word must be longer than " + Integer.toString(Configuration.minwordlength) + " characters.");
					return;
				}
				
				// good, register it and login.
				core.getDB().addLogin(player.getName(), word);
				player.setRegistered(true);
				player.setLoggedIn(true);
			} else if (!player.isLoggedIn()) {
				// process login
				
				if (!core.getDB().checkLogin(player.getName(), word)) {
					player.getPlayer().sendMessage(Configuration.prefix + ChatColor.RED + "Your secret word is incorrect!");
					if (player.triggerAttempt()) {
						core.getDB().secplayers.remove(player.getName());
						core.getDB().failedlogins++;
					}
					
					return;
				}
				
				player.setLoggedIn(true);
			}
		}
	}