public void onEnable() {
		YamlConfiguration config = (YamlConfiguration) this.getConfig();
		PluginDescriptionFile pdfFile = this.getDescription();
		//Write the default configuration stored
		new File(maindir).mkdir();
		createDefaultConfiguration("config.yml");
		
		String channelName = config.getString("channel", "default");
		if(channelName.equalsIgnoreCase("default")){
			channel = JTS3ServerQuery.TEXTMESSAGE_TARGET_GLOBAL;
		}else{
			channel = Integer.parseInt(dquery.channelFind(channelName));
		}
		loadCommands();
		PluginManager pm = getServer().getPluginManager();
		pm.registerEvents(playerListener, this);
		String host = config.getString("Host","localhost");
		int vport = config.getInt("ServerPort", 9987);
		int port = config.getInt("QueryPort",10011);
		//String chID = config.getString("Channel", "default");
		if (!query.connectTS3Query(host , port)){
			log.log(Level.INFO, "[" + pdfFile.getName() + "]" + " is unable to be enabled!");
			echoError();
			return;
		}
		
		String admin = config.getString("ServerAdminUsername","serveradmin");
		String pass = config.getString("ServerAdminPassword","password");
		query.loginTS3(admin, pass);
		
		log.log(Level.INFO, "[" + pdfFile.getName() + "]" + " Logged into Team Speak 3 Server!");
		//Register JTS3ServerQuery Listeners
		query.setTeamspeakActionListener(tslistener);
		if (!query.selectVirtualServer(vport, true))
		{
			echoError();
			return;
		}
		if (!query.addEventNotify(JTS3ServerQuery.EVENT_MODE_TEXTSERVER, 0)){
			echoError();
			return;
		}
		if (!query.addEventNotify(JTS3ServerQuery.EVENT_MODE_TEXTCHANNEL, 0)){
			echoError();
			return;
		}
		if (!query.addEventNotify(JTS3ServerQuery.EVENT_MODE_SERVER, 0)){
			echoError();
			return;
		}
		log.log(Level.INFO, "[" + pdfFile.getName() + "]" + " is enabled!");
		String displayName = config.getString("DisplayName", "MC");
		if (query.setDisplayName(displayName)){
			log.log(Level.INFO, "[" + pdfFile.getName() + "]" + " Nickname changed to " + displayName + "!");
		}
		//Enable the Keep Alive
		getServer().getScheduler().scheduleAsyncRepeatingTask(this, this.keepalive, 300, 300);
	}