mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-29 13:04:59 +00:00
4.7 KiB
4.7 KiB
| name | description |
|---|---|
| mcc-dev-workflow | Build, run, and debug Minecraft Console Client (MCC) against a real local Minecraft Java server in WSL. Use this whenever the user wants to compile MCC, start or inspect a local test server, connect MCC to a server, debug protocol or login issues, validate a code change end-to-end, or run MCC commands on a real server instead of guessing from static code. |
MCC Development Workflow
Use this skill when the task needs a real local server loop, not just code reading.
Defaults
- Solution:
MinecraftClient.sln - Runtime target:
.NET 10/net10.0 - Environment: WSL Ubuntu, Java 21, tmux, python3
- Default server root:
${MCC_SERVERS:-$MCC_REPO/MinecraftOfficial/downloads} - Default validation target when the user does not specify a version:
1.21.11-Vanilla
Core rules
- Prefer a real local server over static reasoning for protocol, login, movement, inventory, entity, or command-path work.
- Treat tmux
mc-*sessions as shared state. Do not run multi-version server workflows in parallel unless the harness explicitly isolates them. - For scripted or repeatable runs, prefer a temporary config copied from
MinecraftClient.ini. Use the repo-root config only for ad hoc manual work. - A server log line containing
Done (means startup finished. It does not guarantee that RCON is ready on the first attempt. Retry earlymc-rconcommands. - When instructions, docs, and code disagree, trust current code and current tool behavior first.
Build
dotnet build MinecraftClient.sln -c Release
Server management
Interactive shell:
source tools/mcc-env.sh
mc-start 1.21.11-Vanilla
mc-log 1.21.11-Vanilla 100
mc-rcon "op CursorBot"
mc-stop 1.21.11-Vanilla
Non-interactive shell:
tools/start-server.sh 1.21.11-Vanilla
tools/mc-rcon.sh "op CursorBot"
If the servers live outside the repo, set MCC_SERVERS before sourcing or invoking the tools:
export MCC_SERVERS=/home/anon/Minecraft/Servers
source tools/mcc-env.sh
Recommended automation recipe
Use this for reproducible local runs:
- Source
tools/mcc-env.sh. - Pick a concrete server directory, usually
1.21.11-Vanilla. - Copy
MinecraftClient.inito a temp location and pin the account, version, and feature gates there. - Start the server and wait for
Done (in the tmux log. - Launch MCC with
MCC_FILE_INPUT=1 dotnet run --project MinecraftClient -c Release --no-build -- "<temp-config>". - Drive MCC through
mcc_input.txt. - Stop MCC and the server cleanly, then keep the temp logs.
Temporary config recipe
source tools/mcc-env.sh
TEST_ROOT="${TMPDIR:-/tmp}/mcc-dev"
CFG="$TEST_ROOT/MinecraftClient.1.21.11.ini"
mkdir -p "$TEST_ROOT"
cp "$MCC_REPO/MinecraftClient.ini" "$CFG"
sed -i \
-e 's/Account = { Login = "test", Password = "-" }/Account = { Login = "CursorBot", Password = "-" }/' \
-e 's/MinecraftVersion = "auto"/MinecraftVersion = "1.21.11"/' \
-e 's/TerrainAndMovements = false/TerrainAndMovements = true/' \
-e 's/InventoryHandling = false/InventoryHandling = true/' \
-e 's/EntityHandling = false/EntityHandling = true/' \
"$CFG"
Add extra sed -i edits only for the scenario you are testing.
Run MCC
Direct temp-config launch:
cd "$MCC_REPO"
MCC_FILE_INPUT=1 dotnet run --project MinecraftClient -c Release --no-build -- "$CFG" 2>&1
Quick manual launch with the repo-root config:
source tools/mcc-env.sh
mcc-run 25565
mcc-run is fine for manual smoke tests. Use a temp config for repeatable automation.
Verify connection and a basic command
MCC output should include:
[MCC] Server was successfully joined.
Server output should include:
CursorBot joined the game
Basic command check:
echo "inventory player list" >> mcc_input.txt
Typical debug loop
source tools/mcc-env.shdotnet build MinecraftClient.sln -c Release- start
1.21.11-Vanilla - wait for
Done ( - launch MCC with a temp config
- confirm the join in both logs
- run one MCC command and one server command
- inspect logs
- stop both sides and iterate
Debugging tips
- Protocol mismatches usually show up as a version line such as
Server version : 1.21.11 (protocol vNNN)before the failure. - If an early
mc-rconcommand fails, retry it before assuming the server setup is broken. - If a supposedly isolated run behaves strangely, check
tmux list-sessionsand kill stalemc-*sessions first. - Legacy
1.8and1.8.9servers may needuse-native-transport=falseinserver.propertieson some Linux environments. - For timing-sensitive work, do not trust wall-clock intuition. Use a real server run and capture evidence from logs or test scripts.