Minecraftconsoles Lce

reason-machines/trending-skills/skills/minecraftconsoles-lce

作者 reason-machines2384a003145a无许可证83 个星标收录于 2026年10月8日更新于 2026年10月8日仓库3个月前更新

Expert skill for building, running, and extending MinecraftConsoles (Minecraft Legacy Console Edition) — a C++ multi-platform reimplementation with dedicated server, LAN multiplayer, and modding support.

AI 生成的概览

指导构建、运行、配置和扩展 MinecraftConsoles 旧版主机版 C++ 项目。

功能
提供使用 Visual Studio 2022 或 CMake 构建 MinecraftConsoles(Minecraft 旧版主机版的 C++ 重实现)以及运行客户端和专用服务器的说明。文档涵盖键鼠操作、局域网多人端口、server.properties 配置项、服务器命令行参数以及 Docker/Wine 部署。还给出添加按键绑定、启动参数和解析 server.properties 的 C++ 代码模式,并包含故障排查与贡献说明。
适用场景
适用于安装、编译或运行 MinecraftConsoles,或配置其专用服务器、局域网多人游戏和 Docker 部署时。也适合在扩展代码库、添加输入绑定、启动参数或配置处理时参考。
运行要求
仅为说明文档,不含脚本。构建需要 Windows、带 C++ 桌面工作负载和 Windows SDK 的 Visual Studio 2022,或使用 Visual Studio 17 2022 生成器的 CMake,以及 Git。在 Docker 中运行专用服务器需要 Docker 和 Compose;Linux/Wine 方式使用 Xvfb。克隆仓库或下载每日构建需要网络访问。

MinecraftConsoles (Legacy Console Edition) Skill

Skill by ara.so — Daily 2026 Skills collection.

What This Project Is

MinecraftConsoles is a C++ reimplementation/continuation of Minecraft Legacy Console Edition v1.6.0560.0 (TU19), targeting modern Windows (and unofficially macOS/Linux via Wine). Goals include:

  • Multi-platform base for modding, backports, and LCE development
  • Quality desktop experience with keyboard/mouse and controller support
  • LAN multiplayer and dedicated server software
  • Splitscreen multiplayer support

Repository: smartcmd/MinecraftConsoles
Primary language: C++
Build system: Visual Studio 2022 solution (.sln) + CMake support


Quick Start

Prerequisites

Clone

bash
git clone https://github.com/smartcmd/MinecraftConsoles.gitcd MinecraftConsoles

Build with Visual Studio

  1. Open MinecraftConsoles.sln in Visual Studio 2022
  2. Set Startup Project to Minecraft.Client
  3. Set configuration to Debug (or Release), platform to Windows64
  4. Press F5 or Ctrl+F5 to build and run

Build with CMake (Windows x64)

powershell
# Configurecmake -S . -B build -G "Visual Studio 17 2022" -A x64
# Build the clientcmake --build build --config Debug --target MinecraftClient
# Build the dedicated servercmake --build build --config Debug --target MinecraftServer

See COMPILE.md in the repo for additional platform-specific notes.


Running the Client

Nightly Build (No Compile Needed)

Download the .zip from the Nightly Release, extract, and run Minecraft.Client.exe.

Setting Your Username

Create username.txt in the same directory as the executable:

Steve

Or use a launch argument:

powershell
Minecraft.Client.exe -name SteveMinecraft.Client.exe -name Steve -fullscreen

Client Launch Arguments

ArgumentDescription
-name <username>Override in-game username
-fullscreenLaunch in fullscreen mode

Keyboard & Mouse Controls

ActionKey/Button
MoveW A S D
Jump / Fly UpSpace
Sneak / Fly DownShift (hold)
SprintCtrl (hold) or double-tap W
InventoryE
ChatT
Drop ItemQ
CraftingC (tabs: Q / E)
Attack / DestroyLeft Click
Use / PlaceRight Click
Select hotbar slot1–9 or Mouse Wheel
PauseEsc
FullscreenF11
Toggle HUDF1
Toggle Debug InfoF3
Debug OverlayF4
Toggle Debug ConsoleF6
Toggle FPS/TPS viewF5
Player list / Host OptionsTab
Accept tutorial hintEnter
Decline tutorial hintB

LAN Multiplayer

LAN multiplayer works automatically on the Windows build:

  • Hosting a world auto-advertises it on the local network
  • Other players discover sessions via Join Game menu
  • TCP port: 25565 (game connections)
  • UDP port: 25566 (LAN discovery)
  • Use the Add Server button to connect to known IPs
  • Username changes are safe — keep uid.dat to preserve your data across renames
  • Splitscreen players can join LAN/multiplayer sessions

Dedicated Server

Download Nightly Server Build

Nightly Dedicated Server

Run Directly (Windows)

powershell
Minecraft.Server.exe -name MyServer -port 25565 -ip 0.0.0.0 -maxplayers 8 -loglevel infoMinecraft.Server.exe -seed 123456789

Server CLI Arguments

ArgumentDescription
-port <1-65535>Override server-port
-ip <addr>Override server-ip (bind address)
-bind <addr>Alias of -ip
-name <name>Override server-name (max 16 chars)
-maxplayers <1-8>Override max-players
-seed <int64>Override level-seed
-loglevel <level>debug, info, warn, error
-help / --help / -hPrint usage and exit

server.properties Configuration

Located in the same directory as Minecraft.Server.exe. Auto-generated with defaults if missing.

properties
server-name=DedicatedServerserver-port=25565server-ip=0.0.0.0max-players=8level-name=worldlevel-id=worldlevel-seed=world-size=classiclog-level=infowhite-list=falselan-advertise=falseautosave-interval=60

Key property notes:

KeyValuesDefaultNotes
server-port1–6553525565TCP listen port
server-ipstring0.0.0.0Bind address
server-namestringDedicatedServerMax 16 chars
max-players1–88Player slots
level-seedint64 or emptyemptyEmpty = random
world-sizeclassic|small|medium|largeclassicNew world size
log-leveldebug|info|warn|errorinfoVerbosity
autosave-interval5–360060Seconds between autosaves
white-listtrue/falsefalseEnable whitelist
lan-advertisetrue/falsefalseLAN advertisement

Dedicated Server in Docker (Linux/Wine)

Recommended: Pull from GHCR (No Local Build)

bash
# Start (pulls latest image automatically)./start-dedicated-server.sh
# Start without pulling./start-dedicated-server.sh --no-pull
# Equivalent manual commanddocker compose -f docker-compose.dedicated-server.ghcr.yml up -d

Local Build Mode (Optional)

Requires a locally compiled Minecraft.Server.exe:

bash
docker compose -f docker-compose.dedicated-server.yml up -d --build

Docker Persistent Volumes

Host PathContainer PathPurpose
./server-data/server.properties/srv/mc/server.propertiesServer config
./server-data/GameHDD/srv/mc/Windows64/GameHDDWorld save data

Docker Environment Variables

VariableDefaultDescription
XVFB_DISPLAY:99Virtual display number
XVFB_SCREEN64x64x16Virtual screen size (tiny, Wine needs it)

Project Structure (Key Areas)

MinecraftConsoles/├── MinecraftConsoles.sln       # Visual Studio solution├── CMakeLists.txt              # CMake build definition├── COMPILE.md                  # Detailed compile instructions├── CONTRIBUTING.md             # Contributor guide and project goals├── docker-compose.dedicated-server.ghcr.yml  # Docker (GHCR image)├── docker-compose.dedicated-server.yml       # Docker (local build)├── start-dedicated-server.sh   # Quick-start script├── server-data/│   ├── server.properties       # Server config (auto-generated)│   └── GameHDD/                # World save data└── .github/    └── banner.png

Common C++ Patterns in This Codebase

Adding a New Key Binding (Keyboard Input)

The project added keyboard/mouse support on top of the original controller-only code. When extending input:

cpp
// Typical pattern for checking key state in the input handler// Find the keyboard input processing file and add your key check:
bool isKeyPressed(int virtualKey) {    return (GetAsyncKeyState(virtualKey) & 0x8000) != 0;}
// Example: adding a new toggle keyif (isKeyPressed(VK_F7)) {    // toggle your feature    myFeatureEnabled = !myFeatureEnabled;}

Registering a Launch Argument

Follow the existing -name / -fullscreen pattern:

cpp
// In the argument parsing section (typically in main or init):for (int i = 1; i < argc; i++) {    std::string arg = argv[i];
    if (arg == "-name" && i + 1 < argc) {        username = argv[++i];    }    else if (arg == "-fullscreen") {        launchFullscreen = true;    }    // Add your argument:    else if (arg == "-myoption" && i + 1 < argc) {        myOption = argv[++i];    }}

Reading server.properties

cpp
#include <fstream>#include <sstream>#include <map>#include <string>
std::map<std::string, std::string> loadServerProperties(const std::string& path) {    std::map<std::string, std::string> props;    std::ifstream file(path);    std::string line;
    while (std::getline(file, line)) {        if (line.empty() || line[0] == '#') continue;        auto eq = line.find('=');        if (eq == std::string::npos) continue;        std::string key = line.substr(0, eq);        std::string val = line.substr(eq + 1);        props[key] = val;    }    return props;}
// Usage:auto props = loadServerProperties("server.properties");int port = std::stoi(props.count("server-port") ? props["server-port"] : "25565");std::string serverName = props.count("server-name") ? props["server-name"] : "DedicatedServer";

Writing server.properties (Normalize / Auto-generate)

cpp
void writeServerProperties(const std::string& path,                            const std::map<std::string, std::string>& props) {    std::ofstream file(path);    for (auto& [key, val] : props) {        file << key << "=" << val << "\n";    }}
// Normalize level-id from level-namestd::string normalizeLevelId(const std::string& levelName) {    std::string id = levelName;    // Remove unsafe characters, lowercase, replace spaces with underscores    for (char& c : id) {        if (!std::isalnum(c) && c != '_' && c != '-') c = '_';    }    return id;}

Troubleshooting

Build Fails: Missing Windows SDK

  • Open Visual Studio Installer → Modify → add Windows 10/11 SDK
  • Make sure the platform is set to Windows64 (not x86)

CMake Can't Find Visual Studio Generator

powershell
# Confirm VS 2022 is installed, then:cmake -S . -B build -G "Visual Studio 17 2022" -A x64# "17 2022" is the generator name for VS 2022

Game Launches But No Display / Crashes Immediately

  • Ensure you're running from the directory containing all game assets
  • Check that your GPU drivers support the required DirectX version
  • Try Debug build for more verbose error output

Server Not Visible on LAN

  • Check firewall rules allow TCP 25565 and UDP 25566
  • Verify lan-advertise=true is NOT required for dedicated servers (it's for LAN broadcast; clients discover via Join Game)
  • Ensure both client and server are on the same subnet

Docker Server: Wine Can't Display

  • The XVFB_DISPLAY env var must match what Wine uses
  • The container uses a minimal 64x64x16 virtual framebuffer — don't change this unless you have a reason

Username Reset / UID Issues

  • Do not delete uid.dat — it stores your unique player ID
  • If you rename yourself via -name or username.txt, your existing uid.dat keeps world data linked to your account

macOS / Linux (Wine)

  • Download the Windows nightly .zip
  • Run via wine Minecraft.Client.exe or CrossOver
  • Stability issues (frametime pacing) are known and community-reported; not officially supported

Contributing

Read CONTRIBUTING.md before submitting PRs. Key points:

  • Follow existing code style and naming conventions
  • Console build compatibility should not be broken without discussion
  • Security fixes are always welcome
  • Check open issues (535+) for good first tasks
  • Join the Discord for contributor discussion

Platform Support Summary

PlatformStatus
Windows (VS 2022)✅ Fully supported
macOS / Linux (Wine)⚠️ Community-reported working, unofficial
Android (Wine)⚠️ Runs with frametime issues
iOS❌ No support
Consoles⚠️ Code present, not actively maintained

来源与署名

来源:reason-machines/trending-skills位于skills/minecraftconsoles-lce提交2384a00

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架