# MCServer ## Flying-squid.createMCServer(options) Create and return an instance of the class MCServer. Options is an object containing the following properties: * port: default to 25565 * host: default to localhost * kickTimeout: default to 10*1000 (10s), kick client that doesn't answer to keepalive after that time * checkTimeoutInterval: defaults to 4*1000 (4s), send keepalive packet at that period * online-mode: defaults to true * beforePing: allow customisation of the answer to ping the server does. It takes a function with argument response and client, response is the default json response, and client is client who sent a ping. It can take as third argument a callback. If the callback is passed, the function should pass its result to the callback, if not it should return. * motd: the string that players see when looking for the server. Defaults to "A Minecraft server" * max-players: the amount of players on the server. Defaults to 20 * logging: defaults to true, enables logging * gameMode: defaults to 0, 0 is survival 1 is creative. * generation: is an object. contains the name and the options for the generator. example: ```json { "name":"diamond_square", "options":{ "worldHeight":80 } } ``` * modpe: defaults to false, wether or not modpe should be enabled. * worldFolder : the world folder of the saved world (containing region, level.dat,...) * plugins * view-distance * player-list-text : an object with keys header and footer, displayed on the player list * everybody-op : true or false, makes everybody op ## Properties ### server.entityMaxId The current maximum ID (i.e. the last entity that was spawned has that id) ### server.players An array of players currently logged in ### server.uuidToPlayer Object for converting UUIDs to players ### server.overworld Contains the overworld world. This is where the default spawn point is ### server.netherworld Contains the nether world. This **WILL** be used when a player travels through a portal if they are in the overworld! ### server.endworld Contains the end world. **NOT YET IMPLEMENTED!** ### server.entities All of the entities ### server.bannedPlayers Object of players that are banned, key is their uuid. Use `server.getUUIDFromUsername()` if you only have their username. Example player: ``` { time: