A fork of prismarine-web-client for my instance
Find a file
dependabot[bot] d82a70a5ad
Bump webpack-dev-middleware from 5.3.3 to 6.0.0 (#332)
Bumps [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware) from 5.3.3 to 6.0.0.
- [Release notes](https://github.com/webpack/webpack-dev-middleware/releases)
- [Changelog](https://github.com/webpack/webpack-dev-middleware/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-dev-middleware/compare/v5.3.3...v6.0.0)

---
updated-dependencies:
- dependency-name: webpack-dev-middleware
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-29 03:04:46 +01:00
.github Upgrade to GitHub-native Dependabot (#181) 2021-05-02 01:03:49 +02:00
assets added bot version text field, guiScale for small screens and removed unused images (#260) 2021-12-24 21:02:11 +01:00
extra-textures added bot version text field, guiScale for small screens and removed unused images (#260) 2021-12-24 21:02:11 +01:00
lib save all play screen options (#326) 2022-09-30 19:34:35 +02:00
test add code 2021-02-27 22:12:11 +00:00
.dockerignore Added docker support, made config dynamic (#108) 2021-03-21 17:14:14 +01:00
.gitignore add .idea to gitignore (#39) 2021-03-02 14:47:40 +01:00
.gitpod remove custom gitpod as the default one is good enough and faster 2021-03-14 22:58:20 +01:00
.npmignore fix package.json 2021-02-27 22:28:08 +00:00
.npmrc Initial commit 2021-02-27 22:27:59 +01:00
config.json Mineflayer Bump (#286) 2022-03-10 18:35:14 +01:00
Dockerfile Added docker support, made config dynamic (#108) 2021-03-21 17:14:14 +01:00
HISTORY.md Release 1.4.0 2022-07-07 00:37:39 +02:00
index.html connect using url params (#285) 2022-03-08 15:46:50 +01:00
index.js connect using url params (#285) 2022-03-08 15:46:50 +01:00
LICENSE Initial commit 2021-02-27 22:27:59 +01:00
package.json Bump webpack-dev-middleware from 5.3.3 to 6.0.0 (#332) 2022-11-29 03:04:46 +01:00
README.md UI reorganized and options (#257) 2021-12-24 13:00:07 +01:00
README_PT.md added bot version text field, guiScale for small screens and removed unused images (#260) 2021-12-24 21:02:11 +01:00
README_RU.md UI reorganized and options (#257) 2021-12-24 13:00:07 +01:00
screenshot.png Update screenshot.png (#44) 2021-03-07 22:51:08 +01:00
server.js Added docker support, made config dynamic (#108) 2021-03-21 17:14:14 +01:00
styles.css Mobile controls (#262) 2021-12-25 22:50:40 +01:00
webpack.common.js add tls to fallback (#279) 2022-02-08 12:33:51 +01:00
webpack.dev.js Revert "Make dev builds faster (#227)" 2021-11-12 21:04:09 +00:00
webpack.prod.js Revert "Make dev builds faster (#227)" 2021-11-12 21:04:09 +00:00

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://webclient.prismarine.js.org/

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://webclient.prismarine.js.org/

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

  • Display mobs and players
  • Display blocks
  • Movement (you can move, and you see entities moving live)
  • Place and break blocks

Roadmap

  • Containers (inventory, chests, etc.)
  • Sounds
  • More world interactions (attacking entities, etc.)
  • Cosmetic rendering features (day night cycle, fog, etc.)

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:

  • bot
  • viewer
  • mcData
  • worldView
  • Vec3
  • pathfinder
  • debugMenu

Adding stuff to the debugMenu

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

Some debugging examples

In Chrome DevTools:

  • bot.chat('test') allows you to use the chat
  • bot.chat(JSON.stringify(Object.values(bot.players).map(({username, ping}) => ({username, ping})))) display the ping of everyone
  • window.bot.entity.position.y += 5 jumps
  • bot.chat(JSON.stringify(bot.findBlock({matching:(block) => block.name==='diamond_ore', maxDistance:256}).position)) finds the position of a diamond block
  • bot.physics.stepHeight = 2 allows you to walk about blocks
  • bot.physics.sprintSpeed = 5 walks faster
  • bot.loadPlugin(pathfinder.pathfinder) then bot.pathfinder.goto(new pathfinder.goals.GoalXZ(100, 100)) goes to position 100, 100

For more debugging ideas, read the mineflayer doc.