-
Notifications
You must be signed in to change notification settings - Fork 113
[showcase] kradle-ai fork example #419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Changes from all commits
832f298
24568f1
e70849d
9ad6a84
da999e7
49474fc
5de3de8
725df84
88c6c26
499cb41
aca64d5
996cfd0
8b4045e
016feec
12f6bda
4f6adf1
dd70480
635ff90
ea648bb
b12399a
57ac0b2
06abcd6
2311fcb
c5f4c1a
4185aec
b2a0d8d
da97b76
17bbfbb
f4185de
e1f5177
575cd3b
3e57560
5798d97
a5b8f4d
67f06e2
60f996b
b2ff845
6c602d3
266e4b3
f4818c0
92930e9
fcd70a3
9be5259
b97df7f
a20c597
270e702
44dde60
43b3dbd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: build-single-file | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-and-bundle: | ||
runs-on: ubuntu-latest | ||
permissions: write-all | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@master | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 22 | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v4 | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Build single-file version - minecraft.html | ||
run: pnpm build-single-file && mv dist/single/index.html minecraft.html | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: minecraft.html | ||
path: minecraft.html |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Make Self Host Zip | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-and-bundle: | ||
runs-on: ubuntu-latest | ||
permissions: write-all | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@master | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 22 | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v4 | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Build project | ||
run: pnpm build | ||
|
||
- name: Bundle server.js | ||
run: | | ||
pnpm esbuild server.js --bundle --platform=node --outfile=bundled-server.js --define:process.env.NODE_ENV="'production'" | ||
|
||
- name: Create distribution package | ||
run: | | ||
mkdir -p package | ||
cp -r dist package/ | ||
cp bundled-server.js package/server.js | ||
cd package | ||
zip -r ../self-host.zip . | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: self-host | ||
path: self-host.zip |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -30,6 +30,8 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- run: vercel build --token=${{ secrets.VERCEL_TOKEN }} --prod | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CONFIG_JSON_SOURCE: BUNDLED | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- run: pnpm build-storybook | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- name: Copy playground files | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -43,24 +45,43 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} --prod | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id: deploy | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# publish to github | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- run: cp vercel.json .vercel/output/static/vercel.json | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- uses: peaceiris/actions-gh-pages@v3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
publish_dir: .vercel/output/static | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
force_orphan: true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+50
to
+55
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update GH Pages action to v4. - - uses: peaceiris/actions-gh-pages@v3
+ - uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: .vercel/output/static
force_orphan: true 📝 Committable suggestion
Suggested change
🧰 Tools🪛 actionlint (1.7.7)50-50: the runner of "peaceiris/actions-gh-pages@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue (action) 🤖 Prompt for AI Agents
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- name: Build single-file version - minecraft.html | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
run: pnpm build-single-file && mv dist/single/index.html minecraft.html | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- name: Build self-host version | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
run: pnpm build | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- name: Bundle server.js | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
pnpm esbuild server.js --bundle --platform=node --outfile=bundled-server.js --define:process.env.NODE_ENV="'production'" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- name: Create zip package | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
mkdir -p package | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
cp -r dist package/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
cp bundled-server.js package/server.js | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
cd package | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
zip -r ../self-host.zip . | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+56
to
+71
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Install project deps before local build/package steps. + - name: Install dependencies
+ run: pnpm install --frozen-lockfile
+
- name: Build single-file version - minecraft.html
run: pnpm build-single-file && mv dist/single/index.html minecraft.html
- name: Build self-host version
run: pnpm build Optional: enable caching for faster runs:
📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
pnpx zardoy-release node --footer "This release URL: ${{ steps.deploy.outputs.stdout }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# has possible output: tag | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id: release | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# has output | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- run: cp vercel.json .vercel/output/static/vercel.json | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- uses: peaceiris/actions-gh-pages@v3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
publish_dir: .vercel/output/static | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
force_orphan: true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- name: Set publishing config | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- run: pnpm tsx scripts/buildNpmReact.ts ${{ steps.release.outputs.tag }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if: steps.release.outputs.tag | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# - run: pnpm tsx scripts/buildNpmReact.ts ${{ steps.release.outputs.tag }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# if: steps.release.outputs.tag | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ localSettings.mjs | |
dist* | ||
.DS_Store | ||
.idea/ | ||
world | ||
/world | ||
data*.json | ||
out | ||
*.iml | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1 @@ | ||||||||||||||||||||||||||
** | ||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Repo-wide Prettier disable ( Disabling formatting everywhere invites style drift and noisy diffs. Ignore only generated/output paths instead. Apply: -**
+# Keep source formatted; ignore only generated/build outputs
+node_modules/
+dist/
+build/
+coverage/
+cypress/screenshots/
+cypress/videos/
+package/
+*.zip
+src/generated/
+generated/ If the intent was to prevent formatting of 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -5,8 +5,6 @@ After forking the repository, run the following commands to get started: | |||||
0. Ensure you have [Node.js](https://nodejs.org) installed. Enable corepack with `corepack enable` *(1). | ||||||
1. Install dependencies: `pnpm i` | ||||||
2. Start the project in development mode: `pnpm start` or build the project for production: `pnpm build` | ||||||
3. Read the [Tasks Categories](#tasks-categories) and [Workflow](#workflow) sections below | ||||||
4. Let us know if you are working on something and be sure to open a PR if you got any changes. Happy coding! | ||||||
|
||||||
*(1): If you are getting `Cannot find matching keyid` update corepack to the latest version with `npm i -g corepack`. | ||||||
*(2): If still something doesn't work ensure you have the right nodejs version with `node -v` (tested on 22.x) | ||||||
|
@@ -95,7 +93,7 @@ Also there are [src/generatedClientPackets.ts](src/generatedClientPackets.ts) an | |||||
- Use `start-prod` script to start the project in production mode after running the `build` script to build the project. | ||||||
- If CI is failing on the next branch for some reason, feel free to use the latest commit for release branch. We will update the base branch asap. Please, always make sure to allow maintainers do changes when opening PRs. | ||||||
|
||||||
## Tasks Categories | ||||||
## Tasks Categories (from usptream repo. not relevant to Kradle) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix typos and project reference in section header. “usptream” → “upstream”; “Kradle” doesn’t match this repo. Apply: -## Tasks Categories (from usptream repo. not relevant to Kradle)
+## Tasks Categories (from upstream repo; not specific to this project) 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is kradle? How changes in or are prepared for platform? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain@zardoy Based on my analysis of the codebase, Kradle appears to be a platform that integrates and hosts this Minecraft Web Client. Here's what I found: What is Kradle?Kradle seems to be a service/platform that:
How changes are prepared for Kradle platform:1. Bi-directional Communication (src/iframe.ts)
2. Custom Kradle EventsThe platform supports these custom commands:
3. Platform-specific Features
4. Deployment Integration
The extensive integration suggests Kradle is likely a multiplayer Minecraft platform that uses this web client as its game engine, similar to how platforms like Hypixel or Mineplex might integrate game clients, but built specifically for web-based Minecraft experiences. 🌐 Web query:
💡 Result: Kradle is an AI platform that uses Minecraft as its environment: challenges are hosted on Kradle and runs spawn instances in Minecraft where participants (agents) are controlled by your code. Agents receive JSON observations (game events) and return actions (JavaScript code, often using Mineflayer skills). Kradle provides docs, a Python SDK helper, a skills/examples repo, and tools for creating/chaining challenges and agent modes. Key points:
If you want, I can:
Sources: [1] Kradle “What’s Kradle?” docs, [2] Kradle “How Kradle works” docs, [3] Kradle “Advanced features” (skills/examples), [4] Kradle terms of use. 🌐 Web query:
💡 Result: Kradle.ai is a platform that runs open-ended, interactive AI “evals” inside Minecraft so developers can build and test agents in multiplayer, dynamic challenges. Key points:
Sources: Kradle docs and site. [1][2][3] @zardoy Thank you for the clarification! I now have a much clearer understanding of what Kradle actually is. Let me correct my previous response: What is Kradle?Kradle is an AI platform that uses Minecraft as its environment for running interactive AI agent evaluations and challenges. Specifically:
How changes are prepared for the Kradle platform:Now the extensive integration in the codebase makes perfect sense: 1. Agent Control Interface
2. Evaluation Infrastructure
3. Challenge Environment
So this Minecraft Web Client is essentially the game engine interface that Kradle uses to run its AI agent evaluations in Minecraft worlds. The extensive integration features I identified earlier are all about enabling programmatic control and monitoring of AI agents rather than human players! 🔥 Failed to add learningsLearnings cannot be added due to server error. Please try again. |
||||||
|
||||||
(most important for now are on top). | ||||||
|
||||||
|
@@ -166,7 +164,7 @@ Most of the tasks are straightforward to implement, just be sure to use a debugg | |||||
|
||||||
New React components, improve UI (including mobile support). | ||||||
|
||||||
## Workflow | ||||||
## Workflow (from usptream repo. not relevant to Kradle) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix typos and project reference in section header. Same issue as above. Apply: -## Workflow (from usptream repo. not relevant to Kradle)
+## Workflow (from upstream repo; not specific to this project) 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||
|
||||||
1. Locate the problem on the public test server & make an easily reproducible environment (you can also use local packets replay server or your custom server setup). Dm me for details on public test server / replay server | ||||||
2. Debug the code, find an issue in the code, isolate the problem | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ RUN npm i -g [email protected] | |
# Build arguments | ||
ARG DOWNLOAD_SOUNDS=false | ||
ARG DISABLE_SERVICE_WORKER=false | ||
ARG CONFIG_JSON_SOURCE=REMOTE | ||
# TODO need flat --no-root-optional | ||
RUN node ./scripts/dockerPrepare.mjs | ||
RUN pnpm i | ||
|
@@ -22,8 +23,8 @@ RUN if [ "$DOWNLOAD_SOUNDS" = "true" ] ; then node scripts/downloadSoundsMap.mjs | |
# ENTRYPOINT ["pnpm", "run", "run-all"] | ||
|
||
# only for prod | ||
RUN GITHUB_REPOSITORY=zardoy/minecraft-web-client \ | ||
DISABLE_SERVICE_WORKER=$DISABLE_SERVICE_WORKER \ | ||
RUN DISABLE_SERVICE_WORKER=$DISABLE_SERVICE_WORKER \ | ||
CONFIG_JSON_SOURCE=$CONFIG_JSON_SOURCE \ | ||
pnpm run build | ||
|
||
# ---- Run Stage ---- | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
REGION=us-central1 | ||
PROJECT_ID=mckradle-3c267 | ||
DOCKER_URL=${REGION}-docker.pkg.dev/${PROJECT_ID}/${env}-arenas/web-viewer-client | ||
IMAGE_TAG=${DOCKER_URL}:$(shell git rev-parse --short HEAD) | ||
SERVICE_NAME=web-proxy | ||
|
||
ifndef env | ||
override env = dev | ||
endif | ||
|
||
docker/login: | ||
gcloud auth configure-docker ${REGION}-docker.pkg.dev | ||
|
||
Comment on lines
+11
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Set gcloud project before configuring Artifact Registry auth Avoids accidentally using a wrong active project. docker/login:
- gcloud auth configure-docker ${REGION}-docker.pkg.dev
+ gcloud config set project ${PROJECT_ID}
+ gcloud auth configure-docker ${REGION}-docker.pkg.dev 🤖 Prompt for AI Agents
|
||
docker/build: | ||
docker buildx build --platform linux/amd64,linux/arm64 . -f Dockerfile --load -t ${IMAGE_TAG} | ||
|
||
Comment on lines
+14
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix: buildx cannot combine --platform (multi-arch) with --load Use --push for multi-arch builds, or split a local single-arch target with --load. Apply: docker/build:
- docker buildx build --platform linux/amd64,linux/arm64 . -f Dockerfile --load -t ${IMAGE_TAG}
+ docker buildx build -f Dockerfile --platform linux/amd64,linux/arm64 -t ${IMAGE_TAG} --push . Optionally add a local target: +docker/build-local:
+ docker buildx build -f Dockerfile --platform linux/amd64 -t ${IMAGE_TAG} --load . 🤖 Prompt for AI Agents
|
||
docker/push: | ||
docker push ${IMAGE_TAG} | ||
|
||
deploy: | ||
gcloud run deploy ${SERVICE_NAME} --image ${IMAGE_TAG} --region ${REGION} |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,6 +1,70 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# Minecraft Web Client | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This is a browser implementation of Minecraft we embed inside the Kradle frontend to view session. This repo contains 2 parts - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
## First: A Web Client | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The web client is [deployed to Vercel](https://vercel.com/kradle-f5bad6db/minecraft-web-client) and is accessible at https://mcraft.kradle.ai. The Kradle frontend at https://app.kradle.ai uses an `<iframe>` to embed the viewer. We make use of query parameters to provide the server details to autoconnect. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
## Second: A Websocket Proxy | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Your browser can't connect and communicate directly with a minecraft java server. For this reason, we use a proxy server that can translate those packets into websocket messages, and the other way around. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The proxy is deployed on [GCP Cloud Run](https://console.cloud.google.com/run/detail/us-central1/web-proxy/metrics?project=mckradle-3c267) and is accessible at https://mcproxy.kradle.ai (You can check it's working by adding `/config.json` to the URL) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A proxy instance is stateless and is also not linked to a single client or a to a single minecraft server. A single instance of the proxy is actually capable of multiplexing multiple clients to multiple minecraft servers. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This means the proxy is quite efficient, and when needed, it can easily scale horizontally based on the sessions being viewed (using gcloud run's autoscaling) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
## Local development | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
It's recommended to clone this repo into a folder called `minecraft-web-client` and place it alongside the [`frontend` repo](https://github.com/kradle-ai/frontend). The frontend repo will automatically use it when you run `npm run dev` there. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
### `tl;dr` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
0. Ensure you have [Node.js](https://nodejs.org) installed. Enable corepack with `corepack enable` *(1). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1. Install dependencies: `pnpm i` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2. Start the project in development mode: `pnpm start` or build the project for production: `pnpm build` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
See [CONTRIBUTING](CONTRIBUTING.md) for a breakdown of the repo and troubleshooting tips on getting it setup (it's mostly copied as-is from the upstream repo). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
## Deploy | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
**Web Client** | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Vercel automatically deploys the `next` branch to production. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
**Proxy** | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
You most likely won't need to make any changes to the proxy, and so you don't need to deploy it. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
In the rare occasion you do, here's how. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
0. Make sure your `gcloud` CLI locally is configured to use the gcloud `dev` environment. You'll need permissions to push a docker image to GCR. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1. (only needed first time) Run `make docker/login` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2. Run `make docker/build` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3. Run `make docker/push` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
* (if you run into issues, try `gcloud auth login` and `make docker/login`) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
4. Run `make deploy` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> TODO: We could setup Google Cloud Run continuous deployments to automatically deploy the `next` branch - but we should try not to rebuild on every commit since the proxy doesn't change often. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
## Notes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This repo was cloned and we made some minimal changes needed for a great iframe spectator experience (such as disabling chat and command access, inventory access, a simpler pause menu, making nightime more visible, etc.) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There's still a ton of code bloat here that's not relevant. For example | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
* Loading zip world files | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
* Single player and P2P modes (which uses memfs, peerjs, and other bloat) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
* Use of local storage (this iframe should be mostly stateless to prevent potential discrepencies as we make changes) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
* Unused Github workflows | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
* etc. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+3
to
+61
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix typos/grammar in public README and address markdownlint issues. User-facing docs—apply corrections and use Markdown links to satisfy MD034. -This is a browser implementation of Minecraft we embed inside the Kradle frontend to view session. This repo contains 2 parts -
+This is a browser implementation of Minecraft that we embed inside the Kradle frontend to view sessions. This repo contains two parts:
@@
-The web client is [deployed to Vercel](https://vercel.com/kradle-f5bad6db/minecraft-web-client) and is accessible at https://mcraft.kradle.ai. The Kradle frontend at https://app.kradle.ai uses an `<iframe>` to embed the viewer. We make use of query parameters to provide the server details to autoconnect.
+The web client is [deployed to Vercel](https://vercel.com/kradle-f5bad6db/minecraft-web-client) and is accessible at <https://mcraft.kradle.ai>. The Kradle frontend at <https://app.kradle.ai> uses an `<iframe>` to embed the viewer. We use query parameters to provide the server details to auto‑connect.
@@
-Your browser can't connect and communicate directly with a minecraft java server. For this reason, we use a proxy server that can translate those packets into websocket messages, and the other way around.
+Your browser can't directly connect to a Minecraft Java server. For this reason, we use a proxy server that translates those packets into WebSocket messages, and the other way around.
@@
-It's recommended to clone this repo into a folder called `minecraft-web-client` and place it alongside the [`frontend` repo](https://github.com/kradle-ai/frontend). The frontend repo will automatically use it when you run `npm run dev` there.
+It's recommended to clone this repo into a folder called `minecraft-web-client` and place it alongside the [`frontend` repo](https://github.com/kradle-ai/frontend). The frontend repo will automatically use it when you run `npm run dev` there.
@@
-See [CONTRIBUTING](CONTRIBUTING.md) for a breakdown of the repo and troubleshooting tips on getting it setup (it's mostly copied as-is from the upstream repo).
+See [CONTRIBUTING](CONTRIBUTING.md) for a breakdown of the repo and troubleshooting tips on getting it set up (it's mostly copied as‑is from the upstream repo).
@@
-> TODO: We could setup Google Cloud Run continuous deployments to automatically deploy the `next` branch - but we should try not to rebuild on every commit since the proxy doesn't change often.
+> TODO: We could set up Google Cloud Run continuous deployments to automatically deploy the `next` branch—but we should try not to rebuild on every commit since the proxy doesn't change often.
@@
-This repo was cloned and we made some minimal changes needed for a great iframe spectator experience (such as disabling chat and command access, inventory access, a simpler pause menu, making nightime more visible, etc.)
+This repo was cloned and we made some minimal changes needed for a great iframe spectator experience (such as disabling chat and command access, inventory access, a simpler pause menu, making nighttime more visible, etc.).
@@
-* Use of local storage (this iframe should be mostly stateless to prevent potential discrepencies as we make changes)
+* Use of local storage (this iframe should be mostly stateless to prevent potential discrepancies as we make changes) 📝 Committable suggestion
Suggested change
🧰 Tools🪛 LanguageTool[grammar] ~25-~25: There might be a mistake here. (QB_NEW_EN) [grammar] ~31-~31: There might be a mistake here. (QB_NEW_EN) [grammar] ~42-~42: There might be a mistake here. (QB_NEW_EN) [grammar] ~43-~43: There might be a mistake here. (QB_NEW_EN) [grammar] ~53-~53: There might be a mistake here. (QB_NEW_EN) [grammar] ~54-~54: Ensure spelling is correct (QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1) [grammar] ~57-~57: There might be a mistake here. (QB_NEW_EN) [grammar] ~58-~58: There might be a mistake here. (QB_NEW_EN) [grammar] ~59-~59: There might be a mistake here. (QB_NEW_EN) [grammar] ~60-~60: There might be a mistake here. (QB_NEW_EN) 🪛 markdownlint-cli2 (0.17.2)7-7: Bare URL used (MD034, no-bare-urls) 7-7: Bare URL used (MD034, no-bare-urls) 13-13: Bare URL used (MD034, no-bare-urls) 36-36: Emphasis used instead of a heading (MD036, no-emphasis-as-heading) 🤖 Prompt for AI Agents
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
--- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# Original docs from the [upstream repo](https://github.com/zardoy/minecraft-web-client) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Minecraft **clone** rewritten in TypeScript using the best modern web technologies. Minecraft vanilla-compatible client and integrated server packaged into a single web app. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -14,15 +78,17 @@ For building the project yourself / contributing, see [Development, Debugging & | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- Open any zip world file or even folder in read-write mode! | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- Connect to Java servers running in both offline (cracked) and online mode* (it's possible because of proxy servers, see below) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- Integrated JS server capable of opening Java world saves in any way (folders, zip, web streaming, etc) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- Integrated JS server clone capable of opening Java world saves in any way (folders, zip, web chunks streaming, etc) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- Singleplayer mode with simple world generations! | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- Works offline | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- First-class touch (mobile) & controller support | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- First-class keybindings configuration | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- Advanced Resource pack support: Custom GUI, all textures. Server resource packs are supported with proper CORS configuration. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- Builtin JEI with recipes & descriptions for every item (JEI is creative inventory replacement) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- Builtin JEI with recipes & descriptions for almost every item (JEI is creative inventory replacement) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- Custom protocol channel extensions (eg for custom block models in the world) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- Play with friends over internet! (P2P is powered by Peer.js discovery servers) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- ~~Google Drive support for reading / saving worlds back to the cloud~~ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- Support for custom rendering 3D engines. Modular architecture. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- even even more! | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
All components that are in [Storybook](https://mcraft.fun/storybook) are published as npm module and can be used in other projects: [`minecraft-react`](https://npmjs.com/minecraft-react) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -143,6 +209,7 @@ General: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- **`?setting=<setting_name>:<setting_value>`** - Set and lock the setting on load. You can set multiple settings by separating them with `&` e.g. `?setting=autoParkour:true&setting=renderDistance:4` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- `?modal=<modal>` - Open specific modal on page load eg `keybindings`. Very useful on UI changes testing during dev. For path use `,` as separator. To get currently opened modal type this in the console: `activeModalStack.at(-1).reactType` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- `?replayFileUrl=<url>` - Load and start a packet replay session from a URL with a integrated server. For debugging / previewing recorded sessions. The file must be CORS enabled. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Server specific: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Harden the deployAlwaysUpdate step (quoting, safer test, fail-fast).
Quote PACKAGES, prefer [ -n ... ], add -- before args, and enable strict shell flags to avoid subtle CI breakages.
📝 Committable suggestion
🤖 Prompt for AI Agents