PrismarineJS / prismarine-web-client

Minecraft web client running in your browser
https://prismarinejs.github.io/prismarine-web-client/
MIT License
434 stars 122 forks source link
browser-game minecraft minecraft-client web

prismarine-web-client

NPM version Build Status Discord Try it on gitpod

๐Ÿ‡บ๐Ÿ‡ธ English ๐Ÿ‡ท๐Ÿ‡บ Russian ๐Ÿ‡ต๐Ÿ‡น Portuguese

A Minecraft client running in a web page. Live demo at https://prismarinejs.github.io/prismarine-web-client/

How it Works

prismarine-web-client runs mineflayer and prismarine-viewer in the browser, which connects over WebSocket to a proxy which translates the WebSocket connection into TCP to connect to normal Minecraft servers. Prismarine-web-client is based on:

Check these modules if you want to understand more how it works and contribute!

Screenshot

Screenshot of prismarine-web-client in action

Live Demo

Click on this link to open it in your browser, no installation necessary: https://prismarinejs.github.io/prismarine-web-client/

Tested on Chrome & Firefox for desktop platforms.

Usage

To host it yourself, run these commands in bash:

$ npm install -g prismarine-web-client
$ prismarine-web-client

Finally, open http://localhost:8080 in your browser.

Features

Roadmap

Development

If you're contributing/making changes, you need to install it differently.

First, clone the repo.

Then, set your working directory to that of the repo. For example:

$ cd ~/prismarine-web-client/

Finally, run

$ npm install
$ npm start

This will start express and webpack in development mode; whenever you save a file, the build will be redone (it takes 5s), and you can refresh the page to get the new result.

Connect to http://localhost:8080 in your browser.

You may want to disable auto saving in your IDE to avoid constant rebuilding; see https://webpack.js.org/guides/development/#adjusting-your-text-editor.

To check the production build (will take a minute to build), you can run npm run build-start.

If you're interested in contributing, you can check projects at https://github.com/PrismarineJS/prismarine-web-client/projects.

Some variables are exposed in the global window object for debugging:

Adding stuff to the debugMenu

debugMenu.customEntries['myKey'] = 'myValue' delete debugMenu.customEntries['myKey']

Some debugging examples

In Chrome DevTools:

For more debugging ideas, read the mineflayer doc.