K0F7zSkHtX
TheBaconGamer

import org.bukkit.Bukkit;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.server.ServerListPingEvent;
import org.bukkit.plugin.java.JavaPlugin;
//Minecraft Maximum Player Plugin 
public class Main extends JavaPlugin implements Listener {

	@Override
	public void onEnable() {
		Bukkit.getServer().getPluginManager().registerEvents(this, this);
		loadConfig();
		saveConfig();
		
	}
	
	private void loadConfig() {
		FileConfiguration c = this.getConfig();
		c.addDefault("MaxPlayers", 500);
		c.options().copyDefaults();
		
	}
	
	@EventHandler
	public void onPing(ServerListPingEvent e) {
		e.setMaxPlayers(getConfig().getInt("MaxPlayers"));
	}
	
}