Skip to content

These docs were made completely by AI, so they might be right, or wrong, you'll need to test them yourself. This was made for a easier understanding of everything. So use at your own risk. If anything is wrong, please don't hurt to make a PR on the page you have a problem with. ON GITHUB

Dedicated Server

The Minecraft.Server/ module is a standalone dedicated server that runs without rendering or UI. It uses text-based console commands instead of the binary packet-based command system in Minecraft.World. This page covers the full architecture, command list, server properties, and how the pieces connect.

The dedicated server has three main components:

Minecraft.Server/
├── Core/
│ ├── DedicatedServer.h/.cpp # Main server class
│ ├── ServerProperties.h/.cpp # Config file parser
│ └── main.cpp # Entry point
├── Commands/
│ ├── ServerCommand.h # Base command class
│ ├── ConsoleCommandDispatcher.h # Command routing
│ └── ServerCommands.h/.cpp # Command registration + helpers
├── Linux/
│ └── LinuxMain.cpp # Linux entry point
└── Stubs/
└── (platform stubs) # Stub implementations for non-server systems

File: Minecraft.Server/Core/DedicatedServer.h

DedicatedServer extends ConsoleInputSource and is the main server object. It owns a ServerProperties instance and manages the server lifecycle.

class DedicatedServer : public ConsoleInputSource
{
public:
DedicatedServer();
~DedicatedServer();
bool init();
int run();
void shutdown();
virtual void info(const wstring& string);
virtual void warn(const wstring& string);
virtual wstring getConsoleName();
static int consoleInputThread(void *param);
private:
void processConsoleInput();
bool m_running;
ServerProperties m_properties;
};

The server runs a separate thread for reading console input (consoleInputThread), while the main thread runs the game tick loop in run(). The info() and warn() methods handle logging output to the console.

DedicatedServer inherits from ConsoleInputSource (defined in Minecraft.Client/ConsoleInputSource.h), which is the interface for anything that can submit text commands. This is how server commands get their src parameter — it points back to the DedicatedServer instance that received the input.

Files: Minecraft.Server/Core/ServerProperties.h, ServerProperties.cpp

The server reads its configuration from a server.properties file using a simple key=value format with # comments. Here is every property and its default value:

PropertyTypeDefaultNotes
server-portint25565Clamped to 1-65535
level-namestringworldSave directory name
level-seedint640World seed (0 = random)
gamemodeint00=Survival, 1=Creative, 2=Adventure
difficultyint20=Peaceful, 1=Easy, 2=Normal, 3=Hard
max-playersint8Clamped to 1-32
pvpbooltruePlayer vs player combat
trust-playersbooltrueWhether players can build/break
fire-spreadsbooltrueFire spread enabled
tnt-explodesbooltrueTNT explosions enabled
structuresbooltrueGenerate structures
spawn-animalsbooltrueAnimal spawning
spawn-npcsbooltrueVillager spawning
online-modeboolfalseRequire authentication
show-gamertagsbooltrueShow player names
motdstringA Minecraft LCE ServerServer description
white-listboolfalseEnable whitelist
voice-chatboolfalseVoice chat support
level-sizestringlargeWorld size
advertise-lanbooltrueLAN broadcast
server-ipstring(empty)Bind address

The properties file uses the same format as Java Edition’s server.properties:

#Minecraft server properties
#Wed Mar 18 12:00:00 2026
server-port=25565
level-name=world
level-seed=
gamemode=0
difficulty=2
max-players=8
pvp=true
trust-players=true
fire-spreads=true
tnt-explodes=true
structures=true
spawn-animals=true
spawn-npcs=true
online-mode=false
show-gamertags=true
motd=A Minecraft LCE Server
white-list=false
voice-chat=false
level-size=large
advertise-lan=true
server-ip=

The save() method writes a timestamp comment at the top. Blank seeds are written as level-seed= (empty value). Blank IPs are written as server-ip= (empty value).

ServerProperties provides typed accessor methods that read from the internal map<wstring, wstring>:

  • getString(key, defaultVal) returns the raw string value
  • getInt(key, defaultVal) uses _wtoi() to parse integers
  • getBool(key, defaultVal) accepts true/1 and false/0
  • getInt64(key, defaultVal) uses _wtoi64() for 64-bit integers

The dedicated server has its own text-based command system that is completely separate from the binary packet-based CommandDispatcher in Minecraft.World. Server commands are typed into the console and dispatched through ConsoleCommandDispatcher.

File: Minecraft.Server/Commands/ServerCommand.h

class ServerCommand
{
public:
virtual wstring getName() = 0;
virtual wstring getUsage() = 0;
virtual void execute(vector<wstring> args,
ConsoleInputSource *src,
MinecraftServer *server) = 0;
static void notifyAdmins(...);
};

Every server command implements getName() (the command name), getUsage() (help text), and execute() (the actual logic). Arguments come as a vector<wstring> of space-separated tokens.

File: Minecraft.Server/Commands/ConsoleCommandDispatcher.h

Routes commands by name using an internal map<wstring, ServerCommand*>.

class ConsoleCommandDispatcher
{
map<wstring, ServerCommand*> commands;
public:
void addCommand(ServerCommand *cmd);
void performCommand(const wstring& name,
vector<wstring> args,
ConsoleInputSource *src,
MinecraftServer *server);
map<wstring, ServerCommand*>& getCommands();
};

All 27 commands are registered in CreateConsoleCommandDispatcher():

ConsoleCommandDispatcher *CreateConsoleCommandDispatcher()
{
ConsoleCommandDispatcher *d = new ConsoleCommandDispatcher();
d->addCommand(new StopCommand());
d->addCommand(new TpCommand());
d->addCommand(new TimeCommand());
// ... 24 more commands
return d;
}

HandleServerCommand() processes raw console input:

  1. Trims whitespace from the input
  2. Strips a leading / if present
  3. Splits on spaces to get command name + arguments
  4. Lowercases the command name
  5. Dispatches through ConsoleCommandDispatcher

GetServerCommandCompletions() provides tab-completion by matching partial input against command names and online player names.

CommandWhat it does
stopShuts down the server
tpTeleports a player to another player or coordinates
timeSets or queries the world time
toggledownfallToggles rain/snow
giveGives items to a player
enchantEnchants a player’s held item
killKills a player
gamemodeChanges a player’s game mode
listLists online players
kickKicks a player from the server
sayBroadcasts a message to all players
meSends an action message
seedShows the world seed
xpGives experience to a player
defaultgamemodeSets the default game mode for new players
save-allForces a world save
save-offDisables automatic saving
save-onEnables automatic saving
debugToggles debug mode
opGrants operator status to a player
deopRemoves operator status from a player
banBans a player by name
pardonUnbans a player by name
ban-ipBans an IP address
pardon-ipUnbans an IP address
banlistShows the ban list
whitelistManages the whitelist (on/off/add/remove/list)
helpShows available commands

There are two completely separate command systems in LCE:

FeatureServer CommandsGame Commands
LocationMinecraft.Server/Commands/Minecraft.World/
Base classServerCommandCommand
DispatcherConsoleCommandDispatcher (by name)CommandDispatcher (by enum)
InputText from console, split into vector<wstring>Binary byteArray from packets
Count2710
PermissionOperator statusEGameCommand permission levels (0-4)
Used byDedicated server consoleIn-game command UI

The dedicated server commands are modeled after Java Edition’s server console. The game commands are the binary packet commands used by the in-game command system. They overlap in functionality (both have tp, time, give, gamemode, etc.) but are entirely separate implementations.

The Linux/ directory contains LinuxMain.cpp, a Linux-specific entry point. This suggests 4J had at least partial Linux dedicated server support planned. The stubs directory provides placeholder implementations for platform systems that the dedicated server does not need (rendering, UI, etc.).

FileWhat it does
Core/DedicatedServer.h/.cppMain server class, lifecycle, console input thread
Core/ServerProperties.h/.cppConfig file parser with typed accessors
Commands/ServerCommand.hBase class for all server commands
Commands/ConsoleCommandDispatcher.hName-based command routing
Commands/ServerCommands.h/.cppRegistration, input processing, tab completion
Linux/LinuxMain.cppLinux entry point